public override void Load() { var factory = new AuthFactory(); Bind<IAuthUnitOfWork>().To<AuthUnitOfWork>().WithConstructorArgument("factory", factory); Bind<IAccountRepository>().To<AccountRepository>().WithConstructorArgument("factory", factory); Bind<IGroupRepository>().To<GroupRepository>().WithConstructorArgument("factory", factory); Bind<IPermissionRepository>().To<PermissionRepository>().WithConstructorArgument("factory", factory); Bind<IUserStore<User>>().To<UserStore<User>>(); }
public override void Initialize() { base.Initialize(); Fixture = new DatabaseAuthFixture(); Factory = Fixture.Factory; var context = Factory.Get(); IdentityUserStore = new UserStore<User>(); Uow = new AuthUnitOfWork(Factory); }
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); }
public DatabaseAuthFixture() { Factory = new AuthFactory(); UnitOfWork = new AuthUnitOfWork(Factory); }
protected RepositoryBaseAuth(AuthFactory databaseFactory) { DatabaseFactory = databaseFactory; dbset = DataContext.Set <T>(); dataContext = dataContext ?? (DatabaseFactory.Get()); }
public AuthUnitOfWork(AuthFactory dbFactory) { this.dbFactory = dbFactory; }
public AuthUnitOfWork(AuthFactory dbFactory) { this.dbFactory = dbFactory; }