Exemplo n.º 1
0
        public async Task <ActionResult> Get()
        {
            var viewModels = (await ManufacturerManager.GetAllAsync <Manufacturer>()).Select(
                Mapper.Map <Manufacturer, ManufacturerViewModel>).ToArray();

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

            return(View(items));
        }