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);
        }
예제 #3
0
 public ActionResult <List <Pizza> > Get()
 {
     try
     {
         return(pizzaService.GetAll());
     }
     catch (Exception exception)
     {
         return(new ObjectResult(new { Status = 500, Value = exception.Message }));
     }
 }
예제 #4
0
        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
                })
            })));
        }
예제 #5
0
        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));
        }
예제 #7
0
        public IActionResult GetAll()
        {
            var pizzas = _pizzaService.GetAll();

            return(this.Ok(pizzas));
        }
예제 #8
0
 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));
        }