Declarative validation

Hello

I must be missing something since declarative validation works only when there is fluent validator present in the Service.Interface project?

public class SnimiArtikal: IArtikal, IReturn<ArtikalDB>, IPost
{
    [ValidateNotNull]
    public string Sifra { get; set; }
    ...
}

It does not work until I make at least:

public class ArtikalValidator: AbstractValidator<SnimiArtikal>
{
}

I didn’t found anything else in docs that needs to be configured, other than:

Plugins.Add(new ValidationFeature());
Plugins.Add(new SharpPagesFeature());

I don’t use AutoCRUD feature (if that matters).

Thanks

There was an issue when detecting existence of “Property” Validators on Request DTOs (i.e. worked for “Type” validators) which should now be resolved from the latest v5.9.3+ that’s now available on MyGet.

Note: You’ll only need to register ValidationFeature to enable declarative validation:

Plugins.Add(new ValidationFeature());

Which can be disabled with (e.g. if you want to test app without enforcing declarative attributes):

Plugins.Add(new ValidationFeature {
    EnableDeclarativeValidation = false
});