Example #1
0
 public void Add(Message response)
 {
     if (!TextService.IsBadText(response.Text))
     {
         __context.Add(response);
         SaveChanges(response);
     }
 }
Example #2
0
 public async Task AddAsync(Message response, CancellationToken token)
 {
     if (!TextService.IsBadText(response.Text))
     {
         await __context.AddAsync(response, token).ConfigureAwait(false);
         await SaveChangesAsync(response, token);
     }
 }
Example #3
0
        public async Task <Forum> UpdateAsync(Forum forum, CancellationToken token)
        {
            if (!TextService.IsBadText(forum.Name))
            {
                _context.Forums.Update(forum);
                await SaveChangesAsync(token);

                return(forum);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        public async Task <Forum> AddAsync(Forum response, CancellationToken token)
        {
            if (!TextService.IsBadText(response.Name))
            {
                await _context.AddAsync(response, token).ConfigureAwait(false);
                await SaveChangesAsync(token);

                return(response);
            }
            else
            {
                return(null);
            }
        }