6

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.

Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346

0 Answers0