public async Task <TPrimaryKey> InsertAndGetIdAsync(TEntity entity) { entity = await InsertAsync(entity); await _dbContext.SaveChangesAsync(); return(entity.Id); }
public async Task SaveChangesAsync() { if (!_isCommitted) { await _mediator.DispatchDomainEventsAsync(_dbContext); await _dbContext.SaveChangesAsync(); _isCommitted = true; } }