PageModel and IValidatableObject - validation is not invoked

673 views Asked by At

I tried to implement IValidatableObject on my Razor Page model in ASPNET Core 2.

I was surprised that the Validate method was not invoked. Moving all [BindableProperty]s to a new type implementing IValidatableObject did work, however.

Is this the only way? It would be nice to be able to implement IValidatableObject directly on my .Microsoft.AspNetCore.Mvc.RazorPages.PageModel type.

0

There are 0 answers