public async Task <IActionResult> Insert() { QueryResponse <FoodCategory> categories = await foodCategoryService.GetAll(); QueryResponse <Food> foods = await foodService.GetAll(); QueryResponse <Meal> meals = await mealService.GetAll(); ViewBag.Path = environment.ContentRootPath + "//wwwroot//img//refeicao//"; ViewBag.Categories = categories.Data; ViewBag.Foods = foods.Data; ViewBag.Meals = meals.Data; return(View()); }
// GET: Meal public ActionResult Index() { var model = new MealViewModel { Meals = _mealService.GetAll() }; return(View(model)); }
// GET: Home public ActionResult Index() { var model = new HomeViewModel { Categories = _categoryService.GetAll(), Meals = _mealService.GetAll() }; return(View(model)); }
public IActionResult GetAll() { var result = mealManager.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public ActionResult GetGridData(GridParams g, bool?restore) { var isAdmin = WebUtils.IsUserAdmin(); var data = service.GetAll(isAdmin); if (restore.HasValue && isAdmin) { OnCrud(ChangeType.Edit); service.Restore(Convert.ToInt32(g.Key)); } var model = new GridModelBuilder <Meal>(data, g) { KeyProp = o => o.Id, Map = o => new { o.Id, o.Name, o.Comments, o.Picture, o.IsDeleted }, GetItem = () => service.Get(Convert.ToInt32(g.Key)) }.Build(); return(Json(model)); }
public IActionResult GetAll() { var meals = _mealService.GetAll(); return(Ok(meals)); }
[HttpGet][Route("")] public IActionResult GetAll() { var meals = _mealService.GetAll(); return(Ok(meals)); }
public async Task <IActionResult> GetAllMeals() { var result = await _mealService.GetAll(); return(Ok(result)); }
public List <Meal> Get() { return(_mealService.GetAll()); }