问题
It seems protected override DbEntityValidationResult ValidateEntity is removed from IdentityDbContext class in packages ( Microsoft.AspNetCore.Identity.EntityFrameworkCore) in latest versions (2.2.0 and 3.0)
How can I validate database in Core 3.0 or Core 2.2?
回答1:
I know that it was a long time ago but I hope it helps people with futures issues with this topic like me,
I was checking how to do it from Asp.net core 2.2 and I Found this Issue in GitHub. https://github.com/dotnet/efcore/issues/19107
The thing is that if we want to override validation we should use the specific validators that every manager has, roleValidator, userValidator, and others. in this question you can find an implementation of the roleValidator
The last reference that I found that really help me understand how does it work was by checking the source code where you can see the default validators implementation https://github.com/dotnet/aspnetcore/tree/master/src/Identity/Extensions.Core/src
来源:https://stackoverflow.com/questions/59089151/equivalent-of-validateentity-in-core3-0