public Task <IUnitOfWork> CreateAsync() { // If there's an existing, undisposed unit of work, we're trying to nest units of work. Not supported. if (ActiveUnitOfWorkExists()) { throw new Exception( "Cannot create unit of work: A unit of work was created before the previous unit of work was complete."); } var dbContext = _serviceProvider.GetRequiredService <TDbContext>(); _unitOfWork = new EntityFrameworkUnitOfWork <TDbContext>(dbContext); return(Task.FromResult <IUnitOfWork>(_unitOfWork)); }
public EFRepositoryWithIntegerIdEntity(IEntityFrameworkUnitOfWork unitOfWork) : this(unitOfWork.Context) { _unitOfWork = unitOfWork; }
/// <summary> /// ctor /// </summary> /// <param name="unitofwork">Unidad de trabajo</param> public Repositorio(IEntityFrameworkUnitOfWork unitofwork) { this.unitofwork = unitofwork; }
public BaseEFRepository(IEntityFrameworkUnitOfWork unitOfWork) : this(unitOfWork.Context) { _unitOfWork = unitOfWork; }