コード例 #1
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.RegisterConventionalDependencyInject(config =>
     {
         config.Where(t => t.IsStandardType() && t.IsAssignableTo <IPermissionDefinitionProvider>()).AsSelf().Lifetime(ServiceLifetime.Singleton);
         config.Where(t => t.IsStandardType() && t.IsAssignableTo <IPermissionGrantingProvider>()).AsSelf().Lifetime(ServiceLifetime.Singleton);
     });
 }
コード例 #2
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.RegisterConventionalDependencyInject(config =>
     {
         config.Where(t => t.IsAssignableTo <Controller>() || t.AttributeExists <ControllerAttribute>()).AsSelf().Lifetime(ServiceLifetime.Transient);
         config.Where(t => t.IsAssignableTo <PageModel>() || t.AttributeExists <PageModelAttribute>()).AsSelf().Lifetime(ServiceLifetime.Transient);
         config.Where(t => t.IsAssignableTo <ViewComponent>() || t.AttributeExists <ViewComponentAttribute>()).AsSelf().Lifetime(ServiceLifetime.Transient);
     });
 }
コード例 #3
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.RegisterConventionalDependencyInject(config =>
     {
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IEventHandler>() && t.IsAssignableTo <ISingletonDependency>()).AsSelf().Lifetime(ServiceLifetime.Singleton);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IEventHandler>() && t.IsAssignableTo <ITransientDependency>()).AsSelf().Lifetime(ServiceLifetime.Transient);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IEventHandler>() && t.IsAssignableTo <IScopedDependency>()).AsSelf().Lifetime(ServiceLifetime.Scoped);
     });
     context.RegisterEventHandler(c => c.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IEventHandler>()).AutoActivation());
 }
コード例 #4
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.RegisterConventionalDependencyInject(config =>
     {
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <ISingletonDependency>()).AsDefault().Lifetime(ServiceLifetime.Singleton);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <ITransientDependency>()).AsDefault().Lifetime(ServiceLifetime.Transient);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IScopedDependency>()).AsDefault().Lifetime(ServiceLifetime.Scoped);
         config.Where(t => t.IsStandardType()).Where(t => t.AttributeExists <ExposeServicesAttribute>(false)).AsExposeService();
     });
 }
コード例 #5
0
 public void Register(IConventionalRegistrationContext context) => context.RegisterConventionalDependencyInject(config => config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IJob>()).AsSelf().Lifetime(ServiceLifetime.Transient));
コード例 #6
0
 public void Register(IConventionalRegistrationContext context) => context.RegisterConventionalDependencyInject(config => config.Where(t => t.IsClass && !t.IsAbstract && t.IsAssignableToGenericType(typeof(IObjectMapper <,>))).As(ObjectMappingServiceSelector.Instance));