Beispiel #1
0
        //Get all categories
        public IEnumerable <CategoryViewModel> GetAll()
        {
            IEnumerable <CategoryDTO> phoneDtos = auctionService.GetAllCategories();
            var mapper     = new MapperConfiguration(cfg => cfg.CreateMap <CategoryDTO, CategoryViewModel>()).CreateMapper();
            var categories = mapper.Map <IEnumerable <CategoryDTO>, List <CategoryViewModel> >(phoneDtos);

            return(categories);
        }