Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class DonationContext:DbContext
  2. {
  3. public DbSet<DonorModel> DonorModel { get; set; }
  4.  
  5.  
  6. }
  7.  
  8. private DonationContext dc = new DonationContext();
  9. public ActionResult Edit()
  10. {
  11. return View();
  12. }
  13.  
  14. [HttpPost]
  15. public ActionResult Edit(int id)
  16. {
  17. if (ModelState.IsValid)
  18. {
  19. dc.DonorModel.Add(donorModel);
  20. dc.SaveChanges();
  21. return RedirectToAction("Index");
  22. }
  23. return View(donorModel);
  24. }
Add Comment
Please, Sign In to add comment