public async Task <Message> InsertMessage(Message message, CancellationToken cancellationToken = default) { await _dbContext.Messages.AddAsync(message, cancellationToken); var result = await _dbContext.SaveChangesAsync(cancellationToken); return(message); }
public async Task <User> InsertUser(User user, CancellationToken cancellationToken = default) { await _dbContext.Users.AddAsync(user, cancellationToken); await _dbContext.SaveChangesAsync(cancellationToken); return(user); }
public async Task SaveChangesAsync() { await _context.SaveChangesAsync(); }