/// <summary>
 /// Gets all categories from data provider
 /// </summary>
 /// <returns>list of all categories</returns>
 public IEnumerable <CategoryDto> GetAllCategories() =>
 Mapper.Map <IEnumerable <CategoryDto> >(_dataProvider.GetAllCategories());
 public ActionResult Create()
 {
     ViewBag.CategoryId = new SelectList(_categoryDataProvider.GetAllCategories(), "Id", "Name");
     ViewBag.ProducerId = new SelectList(_producerDataProvider.GetAllProducers(), "Id", "Name");
     return(View());
 }
Beispiel #3
0
 public ActionResult Index()
 {
     return(View(_categoryDataProvider.GetAllCategories().ToList()));
 }
Beispiel #4
0
        public PartialViewResult GetAllCategoriesToMenu()
        {
            var allCategories = _categoryDataProvider.GetAllCategories();

            return(PartialView(allCategories));
        }