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 override void Load() { var factory = new AdoNetFactory(); var type = factory.GetType(); Bind<IUnitOfWork>().To<ADOUnitOfWork>().WithConstructorArgument(type, factory); Bind<ITurmaRepository>().To<TurmaRepositorySql>().WithConstructorArgument(type, factory); Bind<IAulaRepository>().To<AulaRepositorySql>().WithConstructorArgument(type, factory); Bind<IAlunoRepository>().To<AlunoRepositorySql>().WithConstructorArgument(type, factory); var authFactory = new AuthFactory(); var typeAuth = authFactory.GetType(); Bind<IAuthUnitOfWork>().To<AuthUnitOfWork>().WithConstructorArgument(typeAuth, authFactory); Bind<IUserStore<User>>().To<IdentityUserStore>().WithConstructorArgument(typeAuth, authFactory); Bind<IAccountRepository>().To<AccountRepository>().WithConstructorArgument(typeAuth, authFactory); Bind<IGroupRepository>().To<GroupRepository>().WithConstructorArgument(typeAuth, authFactory); Bind<IPermissionRepository>().To<PermissionRepository>().WithConstructorArgument(typeAuth, authFactory); }