public ActionResult DeleteConfirmed(int id) { IPaymentRepository repository = new EFPaymentRepository(User.Identity.Name); // Payment payment = db.Payments.Find(id); Payment payment = repository.Get(id); // db.Payments.Remove(payment); // db.SaveChanges(); repository.Delete(payment); return RedirectToAction("Payments", "Asset", new { id = payment.AssetId }); }
// // GET: /Payment/Details/5 public ActionResult Details(int id = 0) { IPaymentRepository repository = new EFPaymentRepository(User.Identity.Name); // Payment payment = db.Payments.Find(id); Payment payment = repository.Get(id); if (payment == null) { return HttpNotFound(); } return View(payment); }