Skip to content
代码片段 群组 项目
未验证 提交 4b6e9330 编辑于 作者: David Acker's avatar David Acker 提交者: GitHub
浏览文件

Remove explicit parameterName (#42026)

上级 885cffdf
No related branches found
No related tags found
无相关合并请求
......@@ -36,7 +36,7 @@ public sealed class Results<TResult1, TResult2> : IResult, IEndpointMetadataProv
/// <inheritdoc/>
public Task ExecuteAsync(HttpContext httpContext)
{
ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));
ArgumentNullException.ThrowIfNull(httpContext);
if (Result is null)
{
......@@ -99,7 +99,7 @@ public sealed class Results<TResult1, TResult2, TResult3> : IResult, IEndpointMe
/// <inheritdoc/>
public Task ExecuteAsync(HttpContext httpContext)
{
ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));
ArgumentNullException.ThrowIfNull(httpContext);
if (Result is null)
{
......@@ -171,7 +171,7 @@ public sealed class Results<TResult1, TResult2, TResult3, TResult4> : IResult, I
/// <inheritdoc/>
public Task ExecuteAsync(HttpContext httpContext)
{
ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));
ArgumentNullException.ThrowIfNull(httpContext);
if (Result is null)
{
......@@ -252,7 +252,7 @@ public sealed class Results<TResult1, TResult2, TResult3, TResult4, TResult5> :
/// <inheritdoc/>
public Task ExecuteAsync(HttpContext httpContext)
{
ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));
ArgumentNullException.ThrowIfNull(httpContext);
if (Result is null)
{
......@@ -342,7 +342,7 @@ public sealed class Results<TResult1, TResult2, TResult3, TResult4, TResult5, TR
/// <inheritdoc/>
public Task ExecuteAsync(HttpContext httpContext)
{
ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));
ArgumentNullException.ThrowIfNull(httpContext);
if (Result is null)
{
......
......@@ -15,7 +15,7 @@ public sealed class ValidationProblem : IResult, IEndpointMetadataProvider
{
internal ValidationProblem(HttpValidationProblemDetails problemDetails)
{
ArgumentNullException.ThrowIfNull(problemDetails, nameof(problemDetails));
ArgumentNullException.ThrowIfNull(problemDetails);
if (problemDetails is { Status: not null and not StatusCodes.Status400BadRequest })
{
throw new ArgumentException($"{nameof(ValidationProblem)} only supports a 400 Bad Request response status code.", nameof(problemDetails));
......
......@@ -137,7 +137,7 @@ public class Program
writer.WriteIndentedLine("/// <inheritdoc/>");
writer.WriteIndentedLine("public Task ExecuteAsync(HttpContext httpContext)");
writer.WriteIndentedLine("{");
writer.WriteIndentedLine(2, "ArgumentNullException.ThrowIfNull(httpContext, nameof(httpContext));");
writer.WriteIndentedLine(2, "ArgumentNullException.ThrowIfNull(httpContext);");
writer.WriteLine();
writer.WriteIndentedLine(2, "if (Result is null)");
writer.WriteIndentedLine(2, "{");
......
......@@ -31,8 +31,8 @@ public static class RateLimitingApplicationBuilderExtensions
/// <returns></returns>
public static IApplicationBuilder UseRateLimiter(this IApplicationBuilder app, RateLimiterOptions options)
{
ArgumentNullException.ThrowIfNull(app, nameof(app));
ArgumentNullException.ThrowIfNull(options, nameof(options));
ArgumentNullException.ThrowIfNull(app);
ArgumentNullException.ThrowIfNull(options);
return app.UseMiddleware<RateLimitingMiddleware>(Options.Create(options));
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册