public ActionResult Create() { CategoryDataAccess cda = new CategoryDataAccess(); ViewData["cats"] = cda.GetAllCategories(); return(View()); }
/// <summary> /// Gets the Categories from Database. /// </summary> private void SetCategories() { IEnumerable <CategoryDTO> dTOs = _dataAccess.GetAllCategories().ToArray(); foreach (var item in dTOs) { var kat = new Category(item.ID, item.Name, item.Opis); _cats.Add(kat); } }
public ActionResult Index() { CategoryDataAccess cda = new CategoryDataAccess(); return(View(cda.GetAllCategories())); }