public void Update(MembershipDeal changedMembershipDeal) { var membershipDeal = context.MembershipDeals.Attach(changedMembershipDeal); membershipDeal.State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); }
public void Delete(int id) { MembershipDeal membershipDeal = context.MembershipDeals.Find(id); if (membershipDeal != null) { context.MembershipDeals.Remove(membershipDeal); context.SaveChanges(); } }
public void Add(MembershipDeal membershipDeal) { context.MembershipDeals.Add(membershipDeal); context.SaveChanges(); }