20 lines
733 B
C#
20 lines
733 B
C#
namespace Tnb.Common.Utils
|
||
{
|
||
//public class SkipNormalizationAttributeConventionalRegistrar : IConventionalRegistrar
|
||
//{
|
||
// public void Register(IServiceCollection services, IConfiguration configuration)
|
||
// {
|
||
// // 注册规范化过滤器时,跳过带有SkipNormalizationAttribute特性的方法
|
||
// services.Configure<ApiOptions>(options =>
|
||
// {
|
||
// options.Normalizers.Add<ApiActionFilter>(descriptor =>
|
||
// {
|
||
// var shouldSkip = descriptor.GetMethodInfo().IsDefined(typeof(SkipNormalizationAttribute), inherit: true);
|
||
// return !shouldSkip;
|
||
// });
|
||
// });
|
||
// }
|
||
//}
|
||
|
||
}
|