asp.net-core - Core3.0中ValidateEntity的等价物

标签 asp.net-core entity-framework-core identity

看来 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/

相关文章:

asp.net-core - CaSTLe Windsor ResolveAll 的网络核心等效项

c# - 在同一 Razor 页面上处理多个表单

visual-studio - 错误 NU1107 检测到 Microsoft.EntityFrameworkCore 的版本冲突。在安装 EF 核心时安装/引用

python - 在 Python 中,单个字符串是否保证相同?

sql - 身份插入问题

sql-server - SQL Server SCOPE_IDENTITY() - 线程安全

c# - 'TimeZoneInfo' 不包含 'ConvertTimeFromUtc' (DNX Core 5.0) 的定义

asp.net - Asp Core 2.0 和 Identity Server v3,受众验证失败

c# - 两个 ASP.NET Core 项目之间的依赖注入(inject)

c# - 为什么单独的 DbContexts 在单元测试期间修改同一个 DbSet?