asp.net-core-2.1 - .net Core 中的 RequiredIf 条件属性

标签 asp.net-core-2.1 .net-core-3.0 model-validation expressiveannotations

如何在 .NET Core 中实现 RequiredIf 条件操作以进行基于模型的验证。

在 ASP.NET MVC 中,曾与 ExpressiveAnnotation 包一起使用,但它不适用于 .NET Core。

最佳答案

UoN.ExpressiveAnnotations.NetCore 是用于 .NET Core 应用程序的包,其功能与用于 MVC 的 ExpressiveAnnotation 包相同

引用网址:https://github.com/uon-nuget/UoN.ExpressiveAnnotations.NetCore

关于asp.net-core-2.1 - .net Core 中的 RequiredIf 条件属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60873755/

相关文章:

c# - 如何使用 HostBuilder Generic Host ref StopAsync OperationCanceledException 设置 ShutdownTimeout

c# - 显示属性中的 ASP .Net Core 3.0 ShortName (DataAnnotations)

c# - 要使用 AD B2C 验证 .NET Core 3.0 WPF 桌面客户端,如何使用默认操作系统浏览器?

ASP.NET MVC 模型验证违反 MVC 规则?

c# - .net Core 在配置不同的配置提供程序时访问 appsettings.json

asp.net-core - 如何在 HubConnection SignalR Core 2.1 中发送参数/查询

c# - .NET Core X509Certificate2 使用(Windows/IIS、Docker、Linux下)

entity-framework-core - Entity Framework 3.0包含无法像在EF Core 2.2中那样在SQL中进行翻译

c# - 没有内容的 POST 请求通过模型验证

asp.net-mvc - 子对象上的 ASP.NET MVC 2 模型验证 (DataAnnotations)