public async Task <JsonResult> Updatetem(FoodViewModel model) { var user = HttpContext.Session.Get <User>(Constants.SessionKeyState); int rolId = user.Role.Id; model.userId = user.Id; model.establishmentId = user.Establishment.id; var entity = model.ToFoodModel(); var response = _foodAgent.UpdateFood(entity); return(await Task.FromResult(Json(response))); }