public async System.Threading.Tasks.Task AddSubject(Subject subject, int teacherId) { await _dataBaseContext.Subject.AddAsync(subject); await _dataBaseContext.SaveChangesAsync(); await AddTeacherToSubject(subject.Id, teacherId); }
public async Task <Chat> CreateChat(string userId1, string userId2) { Chat chat = new Chat { User1Id = userId1, User2Id = userId2 }; await _dataBaseContext.Chat.AddAsync(chat); await _dataBaseContext.SaveChangesAsync(); // _fileService.CreateChatFile(chat); return(chat); }
public async System.Threading.Tasks.Task AddNews(News news) { await _dataBaseContext.News.AddAsync(news); await _dataBaseContext.SaveChangesAsync(); }