public ActionResult CreateLiability(Liability model)
        {
            if (ModelState.IsValid)
            {
                repository.AddLiability(model);
                return RedirectToAction("Liabilities");
            }

            return View(model);
        }
 public ActionResult CreateLiability()
 {
     Liability model = new Liability { UserId = UserId };
     return View(model);
 }
 public ActionResult EditLiability(Liability model)
 {
     repository.UpdateLiability(model);
     return RedirectToAction("Liabilities");
 }
 public ActionResult DeleteLiability(Liability model)
 {
     repository.DeleteLiability(model);
     return RedirectToAction("Liabilities");
 }
 public void AddLiability(Liability model)
 {
     context.Liabilities.Add(model);
     SaveChanges();
 }
 public void UpdateLiability(Liability liability)
 {
     Liability liabilityToUpdate = GetLiability(liability.LiabilityId);
     liabilityToUpdate.Name = liability.Name;
     liabilityToUpdate.Principal = liability.Principal;
     SaveChanges();
 }
 public void DeleteLiability(Liability liability)
 {
     context.Liabilities.Attach(liability);
     context.Liabilities.Remove(liability);
     SaveChanges();
 }