Пример #1
0
        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);
        });
Пример #2
0
 private void _addEntry(ISQEntryModel entry)
 {
     _info.CourseToEntries[entry.Course].Add(entry);
     _info.ProfessorToEntries[entry.Professor].Add(entry);
     _info.Entries.Add(entry);
 }