public void Add(Message response) { if (!TextService.IsBadText(response.Text)) { __context.Add(response); SaveChanges(response); } }
public async Task AddAsync(Message response, CancellationToken token) { if (!TextService.IsBadText(response.Text)) { await __context.AddAsync(response, token).ConfigureAwait(false); await SaveChangesAsync(response, token); } }
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); } }
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); } }