コード例 #1
0
        public static IServiceCollection AddCronusAspNetCore(this IServiceCollection services, Action <CronusTenantOptions> options)
        {
            services.AddSingleton <IControllerFactory, CronusControllerFactory>();
            services.AddSingleton <IAspNetTenantResolver, ResolveTenantFromTenantClaim>();
            services.AddSingleton <ResolveTenantFromTenantClaim, ResolveTenantFromTenantClaim>();

            var opts = new CronusTenantOptions();

            options(opts);
            services.AddSingleton <CronusTenantOptions>(opts);

            return(services);
        }
コード例 #2
0
 public CronusControllerFactory(IControllerActivator controllerActivator, IEnumerable <IControllerPropertyActivator> propertyActivators, CronusTenantOptions options)
 {
     defaultControllerFactory = new DefaultControllerFactory(controllerActivator, propertyActivators);
     this.options             = options;
 }