Exemplo n.º 1
0
        // GET: BeerType
        public ActionResult Index()
        {
            var model = new BeerTypeViewModelIndex();

            model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList();
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            var model = new BeerViewModelIndex();

            model.Filter.BeerTypeDtoList = new List <SelectListItem> {
                new SelectListItem
                {
                    Text  = "Select",
                    Value = "0"
                }
            }.Union(_beerTypeService.GetAll().ToSelectListItemList());
            model.BeerViewModelList = _beerService.GetAllBeers().ToBeerViewModelList();
            return(View(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetAllBeerTypes()
        {
            var beerTypes = await _beerTypeService.GetAll();

            if (beerTypes != null)
            {
                return(new OkObjectResult(beerTypes));
            }

            return(NoContent());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> GetAll()
        {
            var beerTypes = await _beerTypeService.GetAll();

            return(Ok(_mapper.Map <IEnumerable <GetBeerTypeDto> >(beerTypes)));
        }