Skip to content

Commit ea1a1ea

Browse files
committed
order
1 parent 3eef71a commit ea1a1ea

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.vs/BookStore/v16/.suo

2 KB
Binary file not shown.

BookStore/Controllers/OrderController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ public OrderController(IOrderRepository orderRepository, ShopingCart shopingCart
2020
_shopingCart = shopingCart;
2121
}
2222

23-
[Authorize]
23+
//[Authorize]
2424
public IActionResult Checkout()
2525
{
2626
return View();
2727
}
2828

2929
[HttpPost]
30-
[Authorize]
30+
//[Authorize]
3131
public IActionResult CheckOut(Order order)
3232
{
3333
var items = _shopingCart.GetShopingCartItems();

BookStore/Data/Repositories/OrderRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public OrderRepository(BookStoreContext storeContext,ShopingCart shopingCart)
2020
public void CreateOrder(Order order)
2121
{
2222
order.OrderedPlaced = DateTime.Now;
23-
_storeContext.Orders.Add(order);
23+
_storeContext.Orders.Add(order); //Add Order
2424

2525
var shopingCartItems = _shopingCart.ShopingCartItems;
2626
foreach (var item in shopingCartItems)
@@ -32,7 +32,7 @@ public void CreateOrder(Order order)
3232
OrderId = order.Id,
3333
Price = item.Book.Price
3434
};
35-
_storeContext.OrderDetails.Add(orderDetail);
35+
_storeContext.OrderDetails.Add(orderDetail); //Add Order Details
3636
}
3737
_storeContext.SaveChanges();
3838
}

0 commit comments

Comments
 (0)