public IActionResult Edit(int id) { List <SizeViewModel> sizes = _sizeService.GetAll(); ViewBag.SizesForSelection = sizes.ToSelectListItems(); List <PizzaViewModel> pizzas = _pizzaService.GetAll(); ViewBag.PizzasForSelection = pizzas.ToSelectListItems(); return(View(_pizzaSizeService.GetById(id))); }
// GET /api/pizza public IList <PizzaDto> Get() { var pizzas = _pizzaServico.GetAll(); IList <PizzaDto> pizzaDtos = Mapper.Map <IList <Pizza>, IList <PizzaDto> >(pizzas); return(pizzaDtos); }
public ActionResult <List <Pizza> > Get() { try { return(pizzaService.GetAll()); } catch (Exception exception) { return(new ObjectResult(new { Status = 500, Value = exception.Message })); } }
public async Task <IActionResult> GetAll() { var pizzas = await _pizzaService.GetAll(); return(Ok(pizzas.Select(p => new { p.Id, p.Name, Ingredients = p.Ingredients.Select(i => new { Id = i.IngredientId, i.Ingredient.Name }) }))); }
public IHttpActionResult GetAllByWildCard(string demo) { var result = _pizzaService.GetAll(); return(result.IsSuccess ? Ok(result.Value) : (IHttpActionResult)StatusCode(HttpStatusCode.InternalServerError)); }
public IActionResult Index() { var pizzas = _pizzaService.GetAll(); return(View(pizzas)); }
public IActionResult GetAll() { var pizzas = _pizzaService.GetAll(); return(this.Ok(pizzas)); }
public ActionResult <List <PizzaViewModel> > GetAll() { return(_pizzaService.GetAll()); }
//[SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(ServiceResponseBase))] public IActionResult Get() { ServiceResponseBase resp = _pizzaService.GetAll(); return(Ok(resp)); }