看来 protected 覆盖 DbEntityValidationResult ValidateEntity 在最新版本(2.2.0 和 3.0)中,已从包 (Microsoft.AspNetCore.Identity.EntityFrameworkCore) 中的 IdentityDbContext 类中删除
如何验证 Core 3.0 或 Core 2.2 中的数据库?
最佳答案
我知道那是很久以前的事了,但我希望它能帮助像我这样有这个主题的 future 问题的人,
我正在检查如何从 Asp.net core 2.2 执行此操作,并在 GitHub 中发现了此问题。 https://github.com/dotnet/efcore/issues/19107
问题是,如果我们想要覆盖验证,我们应该使用每个管理器都有的特定验证器,roleValidator、userValidator 等。 在 this问题你可以找到roleValidator的实现
我发现真正帮助我理解它是如何工作的最后一个引用是通过检查源代码,您可以在其中看到默认验证器实现 https://github.com/dotnet/aspnetcore/tree/master/src/Identity/Extensions.Core/src
关于asp.net-core - Core3.0中ValidateEntity的等价物,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59089151/