Example #1
0
 public void SaveChanges()
 {
     if (!_isCommitted)
     {
         _mediator.DispatchDomainEventsAsync(_dbContext).Wait();
         _dbContext.SaveChanges();
         _isCommitted = true;
     }
 }
 public TPrimaryKey InsertAndGetId(TEntity entity)
 {
     entity = Insert(entity);
     _dbContext.SaveChanges();
     return(entity.Id);
 }