public ActionResult Create(Bids.Models.Member member) { if (ModelState.IsValid) { //db.Members.Add(member); //db.SaveChanges(); unitOfWork.MemberRepository.Insert(member); unitOfWork.Save(); return(RedirectToAction("Index")); } return(View(member)); }
public ActionResult Edit(Member member) { if (ModelState.IsValid) { //db.Entry(member).State = System.Data.EntityState.Modified; //db.SaveChanges(); //memberRepository.UpdateMember(member); //memberRepository.Save(); unitOfWork.MemberRepository.Update(member); unitOfWork.Save(); return RedirectToAction("Index"); } return View(member); }
void IMemberRepository.UpdateMember(Member member) { context.Entry(member).State = System.Data.EntityState.Modified; }
void IMemberRepository.InsertMember(Member member) { context.Members.Add(member); }