public async Task <ActionResult> Get() { var viewModels = (await ManufacturerManager.GetAllAsync <Manufacturer>()).Select( Mapper.Map <Manufacturer, ManufacturerViewModel>).ToArray(); return(Json(viewModels, AllowGet)); }
public async Task <ActionResult> Index() { var items = (await ManufacturerManager.GetAllAsync <Manufacturer>()) .Select(Mapper.Map <Manufacturer, ManufacturerViewModel>) .OrderBy(x => x.Name).ToArray(); return(View(items)); }