Exemple #1
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.DoConventionalAction <InitializationConventionalAction>(config =>
     {
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IInitializable>());
     });
 }
Exemple #2
0
 public void Register(IConventionalRegistrationContext context)
 {
     context.DoConventionalAction <ConventionalDependencyAction>(config =>
     {
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <ISingletonDependency>()).AsDefault().AsSelf().Lifetime(ServiceLifetime.Singleton);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <ITransientDependency>()).AsDefault().AsSelf().Lifetime(ServiceLifetime.Transient);
         config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IScopedDependency>()).AsDefault().AsSelf().Lifetime(ServiceLifetime.Scoped);
         config.Where(t => t.IsStandardType()).Where(t => t.AttributeExists <ExposeServicesAttribute>(false)).AsExposeService();
     });
 }
Exemple #3
0
 public void Register(IConventionalRegistrationContext context) => context.DoConventionalAction <BackgroundJobsConventionalAction>(c => c.Where(t => t.IsStandardType() && (t.IsAssignableToGenericType(typeof(IBackgroundJob <>)) || t.IsAssignableToGenericType(typeof(IAsyncBackgroundJob <>)))));
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <param name="configureAction"></param>
 /// <returns></returns>
 public static IConventionalRegistrationContext RegisterEventHandler(this IConventionalRegistrationContext context, Action <IConventionalConfiguration <EventHandlerConventionalAction> > configureAction) => context.DoConventionalAction(configureAction);
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <param name="configureAction"></param>
 /// <returns></returns>
 public static IConventionalRegistrationContext RegisterConventionalDependencyInject(this IConventionalRegistrationContext context, Action <IConventionalConfiguration <ConventionalDependencyAction> > configureAction) => context.DoConventionalAction(configureAction);