public ActionResult Categories() { var model = new CategoriesViewModel(); model.CurrentCategories = Service.Categories.GetAll(true).ToList(); return View(model); }
public ActionResult Categories(CategoriesViewModel model) { Service.Categories.Upsert(new Category() { Name = model.Name, HouseholdId = GetHouseholdIdForCurrentUser(), Excluded = model.Excluded }); model.CurrentCategories = Service.Categories.GetAll(true); return PartialView("CategoryListPartial", new CategoriesListViewModel(model.CurrentCategories)); }