public async Task <TPrimaryKey> InsertAndGetIdAsync(TEntity entity)
        {
            entity = await InsertAsync(entity);

            await _dbContext.SaveChangesAsync();

            return(entity.Id);
        }
예제 #2
0
        public async Task SaveChangesAsync()
        {
            if (!_isCommitted)
            {
                await _mediator.DispatchDomainEventsAsync(_dbContext);

                await _dbContext.SaveChangesAsync();

                _isCommitted = true;
            }
        }