asp.net核心上的Request.Unvalidated在哪里? [英] Where is Request.Unvalidated on asp.net-core?

查看:85
本文介绍了asp.net核心上的Request.Unvalidated在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,在经典 ASP.NET MVC 中, Request 上有一个 Unvalidated 属性,该属性允许访问当前请求提供的原始值.

I have noticed that in classic ASP.NET MVC there is an Unvalidated property on Request which allows Access to raw values provided by the current request.

我无法在ASP.NET MVC Core 上标识此属性.还有访问这些信息的方法吗?

I cannot identify this property on ASP.NET MVC Core. Is there still a way to Access that information?

推荐答案

ASP.NET Core不具有与ASP.NET中相同的请求验证功能.以下是 GH问题中的团队回复:

ASP.NET Core doesn't have the same request validation feature as it was in ASP.NET. Here are team responses in GH issue:

RequestValidation始终是相当多孔的,最终我们意识到,validate应该是一个应用程序问题,因为对一个应用程序进行验证的内容对另一应用程序无效,

RequestValidation was always rather porous, and eventually we came to the realisation that validate should be an app concern, because what's validate for one application isn't valid for another,

我们没有计划像System.Web中那样构建请求验证中间件.

We have no plans to ever build a request validation middleware like what existed in System.Web.

也有用:SO 启用asp.net核心请求验证.如果很快,则应改用模型验证.

Also useful: SO Enable asp.net core request validation. If shortly, Model validation should be used instead.

这篇关于asp.net核心上的Request.Unvalidated在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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