// GET: BeerType public ActionResult Index() { var model = new BeerTypeViewModelIndex(); model.BeerTypeViewModelList = _beerTypeService.GetAll().ToBeerTypeModelList(); return(View(model)); }
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)); }
public async Task <IActionResult> GetAllBeerTypes() { var beerTypes = await _beerTypeService.GetAll(); if (beerTypes != null) { return(new OkObjectResult(beerTypes)); } return(NoContent()); }
public async Task <IActionResult> GetAll() { var beerTypes = await _beerTypeService.GetAll(); return(Ok(_mapper.Map <IEnumerable <GetBeerTypeDto> >(beerTypes))); }