0
andmattia created
Hi
I've create a custom Interface and I try to register via Windsor but work fine for a lot of class reather then BackGroundJob. Below the code that I use
public class ImportJob : BackgroundJob<ImportJogArgs>, ITransientDependency, IExposedJob
{
public UserManager UserManager { get; set; }
...
}
// NOT REGISTER
public class ExsposedJobConventionalRegistrar : IConventionalDependencyRegistrar
{
public void RegisterAssembly(IConventionalRegistrationContext context)
{
context.IocManager.IocContainer.Register(
Classes.FromAssembly(context.Assembly)
.BasedOn<IExposedJob>()
.If(type => !type.GetTypeInfo().IsGenericTypeDefinition)
.WithService.Self()
.WithService.Base()
.WithService.AllInterfaces()
);
}
}
// MANUAL FORCE REGISTER
// On module pre init
IocManager.IocContainer.Register(
Component.For<IExposedJob, ImportJob>().ImplementedBy<ImportJob>()
);
I try to change from base class BackgroundJob to anithing else and works fine.