public BoughtProduct UpdateBoughtProduct(BoughtProduct boughtProductChanges) { var boughtProduct = context.BoughtProducts.Attach(boughtProductChanges); boughtProduct.State = EntityState.Modified; context.SaveChanges(); return(boughtProductChanges); }
public BoughtProduct DeleteBoughtProduct(int id) { BoughtProduct boughtProduct = context.BoughtProducts.Find(id); if (boughtProduct != null) { context.BoughtProducts.Remove(boughtProduct); context.SaveChanges(); } return(boughtProduct); }
public BoughtProduct DeleteBoughtProduct(string userId, int productId) { BoughtProduct boughtProduct = (from bp in context.BoughtProducts where bp.AppUserRefId == userId && bp.ProductRefId == productId select bp).FirstOrDefault(); if (boughtProduct != null) { context.BoughtProducts.Remove(boughtProduct); context.SaveChanges(); } return(boughtProduct); }
public BoughtProduct AddBoughtProduct(BoughtProduct boughtProduct) { throw new NotImplementedException(); }
public BoughtProduct UpdateBoughtProduct(BoughtProduct boughtProductChanges) { throw new NotImplementedException(); }
public BoughtProduct AddBoughtProduct(BoughtProduct boughtProduct) { context.BoughtProducts.Add(boughtProduct); context.SaveChanges(); return(boughtProduct); }