Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DonationContext:DbContext
- {
- public DbSet<DonorModel> DonorModel { get; set; }
- }
- private DonationContext dc = new DonationContext();
- public ActionResult Edit()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Edit(int id)
- {
- if (ModelState.IsValid)
- {
- dc.DonorModel.Add(donorModel);
- dc.SaveChanges();
- return RedirectToAction("Index");
- }
- return View(donorModel);
- }
Add Comment
Please, Sign In to add comment