Ejemplo n.º 1
0
        public override void Load(IOptionsResolver optionsResolver, IAssemblyTypesResolver assemblyTypesResolver,
                                  IRegistrationContainer container)
        {
            var types = assemblyTypesResolver.Resolve(Assembly.GetExecutingAssembly());

            container.BulkRegisterByMatchingEndName(types, "Service", RegistrationTarget.Interfaces);
            container.BulkRegisterByMatchingType <IIdentityClaimRefiner>(types, RegistrationTarget.Interfaces);
            //container.Register<IClaimsTransformation, ClaimsRefinementTransformation>(RegistrationLifeTime.Transient);
        }
Ejemplo n.º 2
0
        public override void Load(IOptionsResolver optionsResolver, IAssemblyTypesResolver assemblyTypesResolver,
                                  IRegistrationContainer container)
        {
            var types = assemblyTypesResolver.Resolve(Assembly.GetExecutingAssembly());

            container.BulkRegisterByMatchingEndName(types, "Service", RegistrationTarget.Interfaces);
            container.Register <IHttpContextAccessor, HttpContextAccessor>(RegistrationLifeTime.Singleton);
            container.RegisterFactory(c => (IUserContext) new UserContext(() => c.Resolve <IHttpContextAccessor>().HttpContext, c.Resolve <IRolePoliciesService>(), c.Resolve <IDateService>())
                                      , RegistrationLifeTime.Singleton);
        }
Ejemplo n.º 3
0
        public override void Load(IOptionsResolver optionsResolver, IAssemblyTypesResolver assemblyTypesResolver,
                                  IRegistrationContainer container)
        {
            var types = assemblyTypesResolver.Resolve();

            container.BulkRegisterByMatchingEndName(types, "Service", RegistrationTarget.Interfaces);
            //container.BulkRegisterByMatchingType(typeof(IConfigurationRuleSet), types, RegistrationTarget.Interfaces);
            container.Register <IConfigurationsFactory, ConfigurationsFactory>(RegistrationLifeTime.Singleton);
            container.Register <IDbContextResolver, DbContextResolver>(RegistrationLifeTime.Scoped);
            container.Register <IDbContextFactory, DbContextFactory>(RegistrationLifeTime.Scoped);
            container.Register(typeof(IRepository <>), typeof(DbRepository <>), RegistrationLifeTime.Scoped);
        }
Ejemplo n.º 4
0
        public override void Load(IOptionsResolver optionsResolver, IAssemblyTypesResolver assemblyTypesResolver,
                                  IRegistrationContainer container)
        {
            var types = assemblyTypesResolver.Resolve(Assembly.GetExecutingAssembly());

            //container.BulkRegisterByMatchingType(typeof(IRepository<>), types, RegistrationTarget.Interfaces);
            container.BulkRegisterByMatchingEndName(types, "Service", RegistrationTarget.Interfaces);
            //container.BulkRegisterByMatchingType(typeof(IConfigurationRuleSet), types, RegistrationTarget.Interfaces);
            container.BulkRegisterByMatchingType <EntityBaseConfiguration>(types, RegistrationTarget.AbstractBases);
            container.RegisterDbContext(connectionString => new DbContextOptionsBuilder <SampleDbContext>().UseInMemoryDatabase(connectionString)
                                        .Options);
        }
Ejemplo n.º 5
0
        public override void Load(IOptionsResolver optionsResolver, IAssemblyTypesResolver assemblyTypesResolver, IRegistrationContainer container)
        {
            var types = assemblyTypesResolver.Resolve(Assembly.GetExecutingAssembly());

            container.BulkRegisterByMatchingEndName(types, "Service", RegistrationTarget.Interfaces);
        }