public void Register(IConventionalRegistrationContext context) { context.DoConventionalAction <InitializationConventionalAction>(config => { config.Where(t => t.IsStandardType()).Where(t => t.IsAssignableTo <IInitializable>()); }); }
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(); }); }
public void Register(IConventionalRegistrationContext context) => context.DoConventionalAction <BackgroundJobsConventionalAction>(c => c.Where(t => t.IsStandardType() && (t.IsAssignableToGenericType(typeof(IBackgroundJob <>)) || t.IsAssignableToGenericType(typeof(IAsyncBackgroundJob <>)))));
/// <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);
/// <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);