Exemple #1
0
        public void Configuration(IAppBuilder app)
        {
            LogProvider.SetCurrentLogProvider(new DiagnosticsTraceLogProvider());

            app.Map("/core", coreApp =>
            {
                // allow cross origin calls
                coreApp.UseCors(CorsOptions.AllowAll);

                var factory = EntityFrameworkFactory.Create(
                    connectionStringName: "IdSvr",
                    issuerUri: "https://idsrv3.com",
                    siteName: "Thinktecture IdentityServer v3 - preview 1",
                    publicHostAddress: "http://localhost:3333/core");

                var idsrvOptions = new IdentityServerOptions
                {
                    Factory = factory,
                    AdditionalIdentityProviderConfiguration = ConfigureAdditionalIdentityProviders,
                    ConfigurePlugins = ConfigurePlugins
                };

                coreApp.UseIdentityServer(idsrvOptions);
            });
        }
Exemple #2
0
        public override void Initialize()
        {
            base.Initialize();

            Fixture = new DatabaseEntityFrameworkFixture();

            Factory = Fixture.Factory;

            var context = Factory.Get();

            Uow = new EntityFrameworkUnitOfWork(Factory);

            Database.SetInitializer(new DatabaseTestInitializer());
        }
Exemple #3
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);
            Bind <IClaimRepository>().To <ClaimRepository>().WithConstructorArgument(typeAuth, authFactory);
        }
Exemple #4
0
 protected RepositoryBaseEF(EntityFrameworkFactory databaseFactory)
 {
     DatabaseFactory = databaseFactory;
     dbset           = DataContext.Set <T>();
     dataContext     = dataContext ?? (DatabaseFactory.Get());
 }
Exemple #5
0
 public AlunoRepositoryEF(EntityFrameworkFactory dbFactory)
     : base(dbFactory)
 {
 }
Exemple #6
0
 public EntityFrameworkUnitOfWork(EntityFrameworkFactory dbFactory)
 {
     this.dbFactory = dbFactory;
 }
Exemple #7
0
        public DatabaseEntityFrameworkFixture()
        {
            Factory = new EntityFrameworkFactory();

            UnitOfWork = new EntityFrameworkUnitOfWork(Factory);
        }
Exemple #8
0
 public TurmaRepositoryEF(EntityFrameworkFactory dbFactory)
     : base(dbFactory)
 {
 }