// GET: Orders/Details/5 public ActionResult Details(int id) { var order = _db.GetOrder(id); return(View(order)); }
public async Task <IActionResult> My(int orderId = -1) { if (!int.TryParse(HttpContext.User.FindFirst(x => x.Type == "Id").Value, out var userId)) { return(Unauthorized()); } if (orderId == -1) { return(View(await _orders.GetOrdersForUser(userId))); } var order = await _orders.GetOrder(orderId); if (order.UserId != userId) { return(Unauthorized()); } return(View("Order", order)); }
public async Task <Orders> GetOrder(int ordersID) { return(await iorders.GetOrder(ordersID)); }
public async void TestGetOrderById() { var result = await _ordersClient.GetOrder("00080610"); }