fix: provide validators that Autofac is not handling well
This commit is contained in:
parent
e913818e6f
commit
698e918836
4 changed files with 12 additions and 8 deletions
|
@ -23,9 +23,10 @@ public class ApplyStyleTemplate<TModel> : OperationBase
|
|||
|
||||
private readonly IValidator<ApplyStyleTemplate<TModel>> validator;
|
||||
|
||||
public ApplyStyleTemplate(IValidator<ApplyStyleTemplate<TModel>> validator, HandlebarsTemplateCache cache)
|
||||
public ApplyStyleTemplate(HandlebarsTemplateCache cache)
|
||||
{
|
||||
this.validator = validator;
|
||||
// TODO: Figure out why Autofac won't let us register IValidator of generic classes.
|
||||
this.validator = new ApplyStyleTemplateValidator<TModel>();
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,10 @@ public class RenderContentTemplate<TModel> : OperationBase
|
|||
|
||||
private readonly IValidator<RenderContentTemplate<TModel>> validator;
|
||||
|
||||
public RenderContentTemplate(IValidator<RenderContentTemplate<TModel>> validator, HandlebarsTemplateCache cache)
|
||||
public RenderContentTemplate(HandlebarsTemplateCache cache)
|
||||
{
|
||||
this.validator = validator;
|
||||
// TODO: Figure out why Autofac won't let us register IValidator of generic classes.
|
||||
this.validator = new RenderContentTemplateValidator<TModel>();
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ public class SetInstantFromComponent<TComponent> : OperationBase
|
|||
|
||||
private readonly IValidator<SetInstantFromComponent<TComponent>> validator;
|
||||
|
||||
public SetInstantFromComponent(IValidator<SetInstantFromComponent<TComponent>> validator, Timekeeper clock)
|
||||
public SetInstantFromComponent(Timekeeper clock)
|
||||
{
|
||||
this.validator = validator;
|
||||
// TODO: Figure out why Autofac won't let us register IValidator of generic classes.
|
||||
this.validator = new SetInstantFromComponentValidator<TComponent>();
|
||||
this.clock = clock;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,10 @@ public class CreateIndexEntities<TIndexKey> : OperationBase
|
|||
|
||||
private readonly IValidator<CreateIndexEntities<TIndexKey>> validator;
|
||||
|
||||
public CreateIndexEntities(ILogger logger, IValidator<CreateIndexEntities<TIndexKey>> validator)
|
||||
public CreateIndexEntities(ILogger logger)
|
||||
{
|
||||
this.validator = validator;
|
||||
// TODO: Figure out why Autofac won't let us register IValidator of generic classes.
|
||||
this.validator = new CreateIndexEntitiesValidator<TIndexKey>();
|
||||
this.logger = logger.ForContext(typeof(CreateIndexEntities<>));
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue