示例#1
0
        public async System.Threading.Tasks.Task AddSubject(Subject subject, int teacherId)
        {
            await _dataBaseContext.Subject.AddAsync(subject);

            await _dataBaseContext.SaveChangesAsync();

            await AddTeacherToSubject(subject.Id, teacherId);
        }
示例#2
0
        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);
        }
示例#3
0
        public async System.Threading.Tasks.Task AddNews(News news)
        {
            await _dataBaseContext.News.AddAsync(news);

            await _dataBaseContext.SaveChangesAsync();
        }