コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: AlunoEFTest.cs プロジェクト: thiagosartor/newBack
        public void Initialize()
        {
            Database.SetInitializer(new BaseEFTest());

            _factory = new EntityFrameworkFactory();

            _uow = new EntityFrameworkUnitOfWork(_factory);

            _repoTurma = new TurmaRepositoryEF(_factory);

            _repoAluno = new AlunoRepositoryEF(_factory);
        }
コード例 #3
0
        public DatabaseEntityFrameworkFixture()
        {
            Factory = new EntityFrameworkFactory();

            UnitOfWork = new EntityFrameworkUnitOfWork(Factory);
        }
コード例 #4
0
 public EntityFrameworkUnitOfWork(EntityFrameworkFactory dbFactory)
 {
     this.dbFactory = dbFactory;
 }