public void Insert(TimeSheet timeSheet) { if (dataCollection.Any(ts => ts.ID == timeSheet.ID)) { throw new InvalidOperationException(); } dataCollection.Add(timeSheet); }
public void Update(TimeSheet timeSheet) { if (dataCollection.Any(ts => ts.ID == timeSheet.ID)) { dataCollection.Remove(timeSheet); dataCollection.Add(timeSheet); return; } throw new InvalidOperationException(); }
public void Delete(TimeSheet timeSheet) { dataCollection.Remove(timeSheet); }