public bool Delete(int id) { using (DataModelEntities model = new DataModelEntities()) { bool retVal = false; var item = model.Item.FirstOrDefault(b => b.Id.Equals(id)); if (item != null) { model.DeleteObject(item); model.SaveChanges(); retVal = true; } return(retVal); } }
public bool Delete(int id) { using (DataModelEntities model = new DataModelEntities()) { bool retVal = false; var PaperReference = model.PaperReference.FirstOrDefault(b => b.Id.Equals(id)); if (PaperReference != null) { model.DeleteObject(PaperReference); model.SaveChanges(); retVal = true; } return(retVal); } }