You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"IActionResult instances should not be returned from a {0} Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.",
24
24
"Usage",
25
25
DiagnosticSeverity.Warning,
@@ -28,8 +28,8 @@ internal static class DiagnosticDescriptors
Copy file name to clipboardExpand all lines: src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/DisallowReturningActionResultFromMapMethods.cs
Assert.Equal("'AuthorizeAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
51
+
Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
52
52
}
53
53
54
54
[Fact]
@@ -70,7 +70,7 @@ public async Task MinimalAction_WithMisplacedAttributeAndBlockSyntax_ProducesDia
Assert.Equal("'AuthorizeAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
73
+
Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
Assert.Equal("'AuthorizeAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
98
+
Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
Assert.Equal("'ProducesAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
103
+
Assert.Equal("'ProducesAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
Assert.Equal("'ProducesAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
129
+
Assert.Equal("'ProducesAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
130
130
}
131
131
);
132
132
}
@@ -215,7 +215,7 @@ public static void Hello() { }
Assert.Equal("'AuthorizeAttribute' should be placed on the endpoint delegate to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
218
+
Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective",diagnostic.GetMessage(CultureInfo.InvariantCulture));
0 commit comments