public void Insert(TimeSheetEntry entry) { if (dataCollection.Any(te => te.Id == entry.Id)) { throw new InvalidOperationException(); } dataCollection.Add(entry); }
public void Update(TimeSheetEntry entry) { if (dataCollection.Any(ts => ts.Id == entry.Id)) { dataCollection.Remove(entry); dataCollection.Add(entry); return; } throw new InvalidOperationException(); }
public void Delete(TimeSheetEntry entry) { dataCollection.Remove(entry); }