public override void Load() { var entityFrameworkFactory = new EntityFrameworkFactory(); var type = entityFrameworkFactory.GetType(); Bind<IUnitOfWork>().To<EntityFrameworkUnitOfWork>().WithConstructorArgument(type, entityFrameworkFactory); Bind<ITurmaRepository>().To<TurmaRepositoryEF>().WithConstructorArgument(type, entityFrameworkFactory); Bind<IAulaRepository>().To<AulaRepositoryEF>().WithConstructorArgument(type, entityFrameworkFactory); Bind<IAlunoRepository>().To<AlunoRepositoryEF>().WithConstructorArgument(type, entityFrameworkFactory); var authFactory = new AuthFactory(); var typeAuth = authFactory.GetType(); Bind<IAuthUnitOfWork>().To<AuthUnitOfWork>().WithConstructorArgument(typeAuth, authFactory); Bind<IUserStore<User>>().To<UserStore<User>>();//.WithConstructorArgument(typeAuth, authFactory); Bind<IAccountRepository>().To<AccountRepository>().WithConstructorArgument(typeAuth, authFactory); Bind<IGroupRepository>().To<GroupRepository>().WithConstructorArgument(typeAuth, authFactory); Bind<IPermissionRepository>().To<PermissionRepository>().WithConstructorArgument(typeAuth, authFactory); }
public void Initialize() { Database.SetInitializer(new BaseEFTest()); _factory = new EntityFrameworkFactory(); _uow = new EntityFrameworkUnitOfWork(_factory); _repoTurma = new TurmaRepositoryEF(_factory); _repoAluno = new AlunoRepositoryEF(_factory); }
public DatabaseEntityFrameworkFixture() { Factory = new EntityFrameworkFactory(); UnitOfWork = new EntityFrameworkUnitOfWork(Factory); }
public EntityFrameworkUnitOfWork(EntityFrameworkFactory dbFactory) { this.dbFactory = dbFactory; }