public ActionResult Index() { var data = _categoryService.GetAll(); var viewModel = Mapper.Map <List <ServiceCategory>, List <ServiceCategoryViewModel> >(data); return(View(viewModel)); }
// GET: Admin/ServiceSubCategory/Create public ActionResult Create() { var viewModel = new ServiceSubcategoryViewModel { ServiceCategoriesSelectList = Mapper.Map <List <ServiceCategory>, List <SelectListItem> >(_categoryService.GetAll()) }; AddLocales(viewModel.Locales, (locale, languageId) => { }); return(View(viewModel)); }
public ActionResult Get() { return(Ok( serviceCategoryService.GetAll() )); }
// GET: Admin/Category public ActionResult Index() { //var viewModel = Mapper.Map<IEnumerable<Client>, List<ClientViewModel>>(_clientService.GetAll()); var viewModel = Mapper.Map <List <ServiceCategory>, List <ServiceCategoryViewModel> >(_categoryService.GetAll()); return(View(viewModel)); }