public Task AddAsync(ISQEntryModel entry) => _info.Lock.Write(() => { if (_info.Entries.Contains(entry)) { return(Task.CompletedTask); } _addEntry(entry); _context.IsqEntries.Add(entry); return(Task.CompletedTask); });
private void _addEntry(ISQEntryModel entry) { _info.CourseToEntries[entry.Course].Add(entry); _info.ProfessorToEntries[entry.Professor].Add(entry); _info.Entries.Add(entry); }