public bool Delete(Ariochoob1.Models.DomainModels.Product entity, bool autoSave = true) { try { db.Entry(entity).State = System.Data.EntityState.Deleted; if (autoSave) { return(Convert.ToBoolean(db.SaveChanges())); } else { return(false); } } catch { return(false); } }
public bool Add(Ariochoob1.Models.DomainModels.Product entity, bool autoSave = true) { try { db.Products.Add(entity); if (autoSave) { return(Convert.ToBoolean(db.SaveChanges())); } else { return(false); } } catch { return(false); } }