public bool Delete(EventLog eventLog) { if (eventLog == null) return false; using (var db = new DozpContext()) { db.Entry(eventLog).State = EntityState.Deleted; db.SaveChanges(); } return true; }
public EventLog Create(EventLog eventLog) { if (eventLog == null) return null; using (var db = new DozpContext()) { db.Entry(eventLog).State = EntityState.Added; db.SaveChanges(); } return eventLog; }