public void Delete(long id) { var Recordtodelete = _timeentrycontext.TimeEntryRecords.AsNoTracking().Single(t => t.Id == id); _timeentrycontext.Remove(Recordtodelete); _timeentrycontext.SaveChanges(); }
public void Delete(long id) { TimeEntryRecord timeEntryRecord = _context.TimeEntryRecords.AsNoTracking().Single(t => t.Id == id); if (timeEntryRecord != null) { _context.Remove(timeEntryRecord); _context.SaveChanges(); } }
public void Delete(long id) { Context.Remove(FindRecord(id)); Context.SaveChanges(); }