【问题标题】:Equivalent of ValidateEntity in Core3.0Core 3.0 中验证实体的等价物
【发布时间】:2019-11-28 12:40:21
【问题描述】:

看来 受保护的覆盖 DbEntityValidationResult ValidateEntity 已从最新版本(2.2.0 和 3.0)的包 (Microsoft.AspNetCore.Identity.EntityFrameworkCore) 中的 IdentityDbContext 类中删除

如何在 Core 3.0 或 Core 2.2 中验证数据库?

【问题讨论】:

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


    【解决方案1】:

    我知道那是很久以前的事了,但我希望它能帮助像我这样对这个主题有未来问题的人,

    我正在检查如何从 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

    【讨论】:

    猜你喜欢
    • 2020-10-05
    • 2019-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-27
    • 1970-01-01
    相关资源
    最近更新 更多