Skip to content

Apply code suggestions from Visual Studio #34064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Http/Routing/src/ModelEndpointDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Routing
{
internal class ModelEndpointDataSource : EndpointDataSource
{
private List<DefaultEndpointConventionBuilder> _endpointConventionBuilders;
private readonly List<DefaultEndpointConventionBuilder> _endpointConventionBuilders;

public ModelEndpointDataSource()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private ApiParameterRouteInfo CreateRouteInfo(TemplatePart routeParameter)
};
}

private IEnumerable<string?> GetHttpMethods(ControllerActionDescriptor action)
private static IEnumerable<string?> GetHttpMethods(ControllerActionDescriptor action)
{
if (action.ActionConstraints != null && action.ActionConstraints.Count > 0)
{
Expand All @@ -350,7 +350,7 @@ private ApiParameterRouteInfo CreateRouteInfo(TemplatePart routeParameter)
}
}

private RouteTemplate? ParseTemplate(ControllerActionDescriptor action)
private static RouteTemplate? ParseTemplate(ControllerActionDescriptor action)
{
if (action.AttributeRouteInfo?.Template != null)
{
Expand Down Expand Up @@ -445,7 +445,7 @@ internal static MediaTypeCollection GetDeclaredContentTypes(IReadOnlyList<IApiRe
return contentTypes;
}

private IApiRequestMetadataProvider[]? GetRequestMetadataAttributes(ControllerActionDescriptor action)
private static IApiRequestMetadataProvider[]? GetRequestMetadataAttributes(ControllerActionDescriptor action)
{
if (action.FilterDescriptors == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private static ApiResponseType CreateDefaultApiResponseType(Type responseType)
}

private static EndpointModelMetadata CreateModelMetadata(Type type) =>
new EndpointModelMetadata(ModelMetadataIdentity.ForType(type));
new(ModelMetadataIdentity.ForType(type));

private static void AddResponseContentTypes(IList<ApiResponseFormat> apiResponseFormats, IReadOnlyList<string> contentTypes)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private static (RoutePattern resolvedRoutePattern, IDictionary<string, string?>
return (attributeRoutePattern, resolvedRequiredValues ?? action.RouteValues);
}

private void AddActionDataToBuilder(
private static void AddActionDataToBuilder(
EndpointBuilder builder,
HashSet<string> routeNames,
ActionDescriptor action,
Expand Down