Skip to content

Validator for base interface #44

@ABIOLI-COM

Description

@ABIOLI-COM

Hi Peter.
I'm trying to use this library, but I have a validator for a base interface and two different implementation classes, so that my situation is something like:

public class MyValidator : AbstractValidator<IBaseInterface> {...}

And then I have two 'validatable' classes like in:

public class A : IBaseInterface {...}
public class B : IBaseInterface {...}

I think that the automatic discovery you implemented in this library records only the direct types, so when I have a Blazor form based on an instance of class A, for example, I see that validation doesn't automatically kick in.
I would like to have the possibility to register manually custom behaviors like this case, something like:

builder.Services.RegisterValidator<A, MyValidator>();
builder.Services.RegisterValidator<B, MyValidator>();

...unless I have some other error that I don't see, of course... :-)

Thank you (again :-) )
Andrea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions