在Core3.0中等效于ValidateEntity [英] Equivalent of ValidateEntity in Core3.0

查看:113
本文介绍了在Core3.0中等效于ValidateEntity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)

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

How can I validate database in Core 3.0 or Core 2.2?

推荐答案

我知道这是很久以前,但我希望它能像我一样帮助遇到此类问题的人,

I know that it was a long time ago but I hope it helps people with futures issues with this topic like me,

我正在检查如何从Asp.net core 2.2中进行操作,我发现该问题在GitHub中。
https://github.com/dotnet/efcore/issues/19107

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

问题是,如果我们想覆盖验证,则应该使用每个管理员都拥有的特定验证器,roleValidator,userValidator等。 中的
问您可以找到roleValidator的实现

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

我发现的最后一个真正帮助我理解其工作原理的参考是通过检查源代码,在该代码中可以看到默认的验证器实施 https://github.com/dotnet/aspnetcore /tree/master/src/Identity/Extensions.Core/src

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

这篇关于在Core3.0中等效于ValidateEntity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆