public async Task <IActionResult> Index() { if (!HttpContext.Session.GetInt32("authenticated").HasValue) { return(new RedirectToActionResult("index", "login", null)); } var orders = await orderModel.GetAll(); return(View(orders)); }
public IActionResult GetOrders() { OrderModel model = new OrderModel(_db); return(Ok(model.GetAll(HttpContext.Session.GetString(SessionVars.User)))); }