Skip to content

Commit c9745a6

Browse files
Remove unnecessary compiler directives
1 parent 6ead32f commit c9745a6

29 files changed

+47
-131
lines changed

src/Abstractions/src/Asp.Versioning.Abstractions/ApiVersionParser.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ public virtual ApiVersion Parse( Text text )
187187
/// <inheritdoc />
188188
#if NETSTANDARD1_0
189189
public virtual bool TryParse( Text? text, out ApiVersion apiVersion )
190-
#elif NETSTANDARD2_0
191-
public virtual bool TryParse( Text text, out ApiVersion apiVersion )
192190
#else
193191
public virtual bool TryParse( Text text, [MaybeNullWhen( false )] out ApiVersion apiVersion )
194192
#endif

src/Abstractions/src/Asp.Versioning.Abstractions/Asp.Versioning.Abstractions.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
<Compile Include="$(BackportDir)Array.cs" Visible="false" />
3131
</ItemGroup>
3232

33+
<ItemGroup Condition=" ('$(TargetFramework)' == 'netstandard1.0') OR ('$(TargetFramework)' == 'netstandard2.0') ">
34+
<Compile Include="$(BackportDir)NullableAttributes.cs" Visible="false" />
35+
</ItemGroup>
36+
3337
<ItemGroup Condition=" '$(TargetFramework)' != 'net7.0' ">
3438
<Compile Include="$(BackportDir)BitOperations.cs" Visible="false" />
3539
<Compile Include="$(BackportDir)HashCode.cs" Visible="false" />

src/Abstractions/src/Asp.Versioning.Abstractions/ISunsetPolicyManager.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,5 @@ public interface ISunsetPolicyManager
1818
/// policy for the specified <paramref name="apiVersion">API version</paramref>. If
1919
/// <paramref name="apiVersion">API version</paramref> is <c>null</c>, it is assumed the caller intends to match
2020
/// any sunset policy for the specified <paramref name="name"/>.</remarks>
21-
bool TryGetPolicy(
22-
string? name,
23-
ApiVersion? apiVersion,
24-
#if !NETSTANDARD
25-
[MaybeNullWhen( false )]
26-
#endif
27-
out SunsetPolicy sunsetPolicy );
21+
bool TryGetPolicy( string? name, ApiVersion? apiVersion, [MaybeNullWhen( false )] out SunsetPolicy sunsetPolicy );
2822
}

src/Abstractions/src/Asp.Versioning.Abstractions/ISunsetPolicyManagerExtensions.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ public static class ISunsetPolicyManagerExtensions
1717
public static bool TryGetPolicy(
1818
this ISunsetPolicyManager policyManager,
1919
ApiVersion apiVersion,
20-
#if !NETSTANDARD
21-
[MaybeNullWhen( false )]
22-
#endif
23-
out SunsetPolicy sunsetPolicy )
20+
[MaybeNullWhen( false )] out SunsetPolicy sunsetPolicy )
2421
{
2522
if ( policyManager == null )
2623
{
@@ -40,10 +37,7 @@ public static bool TryGetPolicy(
4037
public static bool TryGetPolicy(
4138
this ISunsetPolicyManager policyManager,
4239
string name,
43-
#if !NETSTANDARD
44-
[MaybeNullWhen( false )]
45-
#endif
46-
out SunsetPolicy sunsetPolicy )
40+
[MaybeNullWhen( false )] out SunsetPolicy sunsetPolicy )
4741
{
4842
if ( policyManager == null )
4943
{
@@ -104,10 +98,7 @@ public static bool TryResolvePolicy(
10498
this ISunsetPolicyManager policyManager,
10599
string? name,
106100
ApiVersion? apiVersion,
107-
#if !NETSTANDARD
108-
[MaybeNullWhen( false )]
109-
#endif
110-
out SunsetPolicy sunsetPolicy )
101+
[MaybeNullWhen( false )] out SunsetPolicy sunsetPolicy )
111102
{
112103
if ( policyManager == null )
113104
{

src/Abstractions/src/Asp.Versioning.Abstractions/LinkHeaderValue.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ public StringSegment Language
161161
public static bool TryParse(
162162
StringSegment input,
163163
Func<Uri, Uri>? resolveRelativeUrl,
164-
#if !NETSTANDARD
165-
[MaybeNullWhen( false )]
166-
#endif
167-
out LinkHeaderValue parsedValue )
164+
[MaybeNullWhen( false )] out LinkHeaderValue parsedValue )
168165
{
169166
#if NETSTANDARD1_0
170167
if ( string.IsNullOrEmpty( input ) )
@@ -302,9 +299,7 @@ public static bool TryParse(
302299
public static bool TryParseList(
303300
IList<string>? input,
304301
Func<Uri, Uri>? resolveRelativeUrl,
305-
#if !NETSTANDARD
306302
[MaybeNullWhen( false )]
307-
#endif
308303
out IList<LinkHeaderValue> parsedValues )
309304
{
310305
if ( input == null )
@@ -404,10 +399,7 @@ private static void AppendTargetAttribute( StringBuilder builder, ReadOnlySpan<c
404399
private static bool TryParseTargetLink(
405400
ref StringSegment segment,
406401
Func<Uri, Uri>? resolveRelativeUrl,
407-
#if !NETSTANDARD
408-
[MaybeNullWhen( false )]
409-
#endif
410-
out Uri targetLink )
402+
[MaybeNullWhen( false )] out Uri targetLink )
411403
{
412404
var start = segment.IndexOf( '<' );
413405

@@ -495,7 +487,7 @@ public bool Remove( KeyValuePair<StringSegment, StringSegment> item ) =>
495487

496488
public bool TryGetValue(
497489
StringSegment key,
498-
#if !NETSTANDARD
490+
#if !NETSTANDARD1_0
499491
[MaybeNullWhen( false )]
500492
#endif
501493
out StringSegment value ) => items.TryGetValue( key, out value );

src/Abstractions/src/Asp.Versioning.Abstractions/netstandard2.0/IApiVersionParser.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,5 @@ public interface IApiVersionParser
2020
/// <param name="text">The text to parse as an API version.</param>
2121
/// <param name="apiVersion">The parsed API version or null.</param>
2222
/// <returns>True if the parsing was successful; otherwise false.</returns>
23-
bool TryParse(
24-
ReadOnlySpan<char> text,
25-
#if !NETSTANDARD
26-
[MaybeNullWhen( false )]
27-
#endif
28-
out ApiVersion apiVersion );
23+
bool TryParse( ReadOnlySpan<char> text, [MaybeNullWhen( false )] out ApiVersion apiVersion );
2924
}

src/Abstractions/src/Asp.Versioning.Abstractions/netstandard2.0/IApiVersionParserExtensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ public static ApiVersion Parse( this IApiVersionParser parser, string? text )
3333
public static bool TryParse(
3434
this IApiVersionParser parser,
3535
string? text,
36-
#if !NETSTANDARD
37-
[MaybeNullWhen( false )]
38-
#endif
39-
out ApiVersion apiVersion )
36+
[MaybeNullWhen( false )] out ApiVersion apiVersion )
4037
{
4138
if ( parser == null )
4239
{

src/AspNet/OData/src/Asp.Versioning.WebApi.OData.ApiExplorer/Asp.Versioning.WebApi.OData.ApiExplorer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<ItemGroup>
1818
<Compile Include="$(BackportDir)BitOperations.cs" Visible="false" />
1919
<Compile Include="$(BackportDir)HashCode.cs" Visible="false" />
20+
<Compile Include="$(BackportDir)NullableAttributes.cs" Visible="false" />
2021
<Compile Include="$(BackportDir)StringExtensions.cs" Visible="false" />
2122
<Compile Include="..\..\..\..\Common\src\Common.OData\TypeExtensions.cs" Link="TypeExtensions.cs" />
2223
<Compile Include="..\..\..\WebApi\src\Asp.Versioning.WebApi.ApiExplorer\System.Web.Http\Controllers\HttpActionDescriptorExtensions.cs" Link="System.Web.Http\Controllers\HttpActionDescriptorExtensions.cs" />

src/AspNet/WebApi/src/Asp.Versioning.WebApi.ApiExplorer/ApiExplorer/VersionedApiExplorer.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ protected virtual Collection<VersionedApiDescription> ExploreRouteControllers(
713713

714714
var apiDescriptions = new Collection<VersionedApiDescription>();
715715
var routeTemplate = route.RouteTemplate;
716-
string controllerVariableValue;
716+
string? controllerVariableValue;
717717

718718
if ( controllerVariableRegex.IsMatch( routeTemplate ) )
719719
{
@@ -734,12 +734,12 @@ protected virtual Collection<VersionedApiDescription> ExploreRouteControllers(
734734
}
735735
}
736736
else if ( route.Defaults.TryGetValue( RouteValueKeys.Controller, out controllerVariableValue ) &&
737-
controllerMappings.TryGetValue( controllerVariableValue, out var controllerDescriptor ) )
737+
controllerMappings.TryGetValue( controllerVariableValue!, out var controllerDescriptor ) )
738738
{
739739
// bound controller variable {controller = "controllerName"}
740740
foreach ( var nestedControllerDescriptor in controllerDescriptor.AsEnumerable() )
741741
{
742-
if ( ShouldExploreController( controllerVariableValue, nestedControllerDescriptor, route, apiVersion ) )
742+
if ( ShouldExploreController( controllerVariableValue!, nestedControllerDescriptor, route, apiVersion ) )
743743
{
744744
ExploreRouteActions( route, routeTemplate, nestedControllerDescriptor, apiDescriptions, apiVersion );
745745
}
@@ -782,7 +782,7 @@ private void ExploreRouteActions(
782782
return;
783783
}
784784

785-
string actionVariableValue;
785+
string? actionVariableValue;
786786

787787
if ( actionVariableRegex.IsMatch( localPath ) )
788788
{
@@ -935,17 +935,8 @@ private static bool ShouldEmitPrefixes( ICollection<ApiParameterDescription> par
935935
parameter.CanConvertPropertiesFromString() ) > 1;
936936
}
937937

938-
private static Type GetCollectionElementType( Type collectionType )
939-
{
940-
var elementType = collectionType.GetElementType();
941-
942-
if ( elementType == null )
943-
{
944-
elementType = typeof( ICollection<> ).GetGenericBinderTypeArgs( collectionType ).First();
945-
}
946-
947-
return elementType;
948-
}
938+
private static Type GetCollectionElementType( Type collectionType ) =>
939+
collectionType.GetElementType() ?? typeof( ICollection<> ).GetGenericBinderTypeArgs( collectionType ).First();
949940

950941
private static void AddPlaceholderForProperties(
951942
Dictionary<string, object> parameterValuesForRoute,

src/AspNet/WebApi/src/Asp.Versioning.WebApi/Asp.Versioning.WebApi.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<ItemGroup>
1818
<Compile Include="$(BackportDir)BitOperations.cs" Visible="false" />
1919
<Compile Include="$(BackportDir)HashCode.cs" Visible="false" />
20+
<Compile Include="$(BackportDir)NullableAttributes.cs" Visible="false" />
2021
</ItemGroup>
2122

2223
<ItemGroup>

src/AspNet/WebApi/src/Asp.Versioning.WebApi/Controllers/ActionSelectorCacheItem.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ private static List<CandidateActionWithParams> GetInitialCandidateWithParameterL
304304
continue;
305305
}
306306

307-
subRouteData.Values.TryGetValue( RouteValueKeys.Action, out string actionName );
307+
subRouteData.Values.TryGetValue( RouteValueKeys.Action, out string? actionName );
308308

309309
for ( var i = 0; i < candidates.Length; i++ )
310310
{
@@ -335,9 +335,9 @@ private CandidateAction[] GetInitialCandidateList( HttpControllerContext control
335335
var routeData = controllerContext.RouteData;
336336
CandidateAction[] candidates;
337337

338-
if ( routeData.Values.TryGetValue( RouteValueKeys.Action, out string actionName ) )
338+
if ( routeData.Values.TryGetValue( RouteValueKeys.Action, out string? actionName ) )
339339
{
340-
var actionsFoundByName = standardActions!.StandardActionNameMapping![actionName].ToArray();
340+
var actionsFoundByName = standardActions!.StandardActionNameMapping![actionName!].ToArray();
341341

342342
if ( actionsFoundByName.Length == 0 )
343343
{

src/AspNet/WebApi/src/Asp.Versioning.WebApi/Conventions/ControllerApiVersionConventionBuilderBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public virtual void ApplyTo( HttpControllerDescriptor item )
5454
/// <param name="method">The <see cref="MethodInfo">method</see> representing the action to retrieve the convention for.</param>
5555
/// <param name="convention">The retrieved <see cref="IApiVersionConvention{T}">convention</see> or <c>null</c>.</param>
5656
/// <returns>True if the convention was successfully retrieved; otherwise, false.</returns>
57-
protected abstract bool TryGetConvention( MethodInfo method, out IApiVersionConvention<HttpActionDescriptor> convention );
57+
protected abstract bool TryGetConvention( MethodInfo method, [MaybeNullWhen( false )] out IApiVersionConvention<HttpActionDescriptor> convention );
5858

5959
private void ApplyActionConventions( HttpControllerDescriptor controller )
6060
{

src/AspNet/WebApi/src/Asp.Versioning.WebApi/Dispatcher/ApiVersionControllerSelector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public virtual IDictionary<string, HttpControllerDescriptor> GetControllerMappin
123123
return null;
124124
}
125125

126-
if ( routeData.Values.TryGetValue( RouteDataTokenKeys.Controller, out string controller ) )
126+
if ( routeData.Values.TryGetValue( RouteDataTokenKeys.Controller, out string? controller ) )
127127
{
128128
return controller;
129129
}

src/AspNet/WebApi/src/Asp.Versioning.WebApi/Routing/ApiVersionRouteConstraint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public bool Match( HttpRequestMessage request, IHttpRoute route, string paramete
3131
return false;
3232
}
3333

34-
if ( !values.TryGetValue( parameterName, out string value ) )
34+
if ( !values.TryGetValue( parameterName, out string? value ) )
3535
{
3636
return false;
3737
}

src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Net.Http/HttpRequestMessageExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public static ApiVersionRequestProperties ApiVersionProperties( this HttpRequest
7878
throw new ArgumentNullException( nameof( request ) );
7979
}
8080

81-
if ( request.Properties.TryGetValue( ApiVersionPropertiesKey, out ApiVersionRequestProperties properties ) )
81+
if ( request.Properties.TryGetValue( ApiVersionPropertiesKey, out ApiVersionRequestProperties? properties ) )
8282
{
83-
return properties;
83+
return properties!;
8484
}
8585

8686
var forceRouteConstraintEvaluation = !request.Properties.ContainsKey( RoutingContextKey );

src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Web.Http/HttpActionDescriptorExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public static ApiVersionMetadata GetApiVersionMetadata( this HttpActionDescripto
2525
throw new ArgumentNullException( nameof( action ) );
2626
}
2727

28-
if ( action.Properties.TryGetValue( typeof( ApiVersionMetadata ), out ApiVersionMetadata value ) )
28+
if ( action.Properties.TryGetValue( typeof( ApiVersionMetadata ), out ApiVersionMetadata? value ) )
2929
{
30-
return value;
30+
return value!;
3131
}
3232

3333
return ApiVersionMetadata.Empty;

src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Web.Http/HttpControllerDescriptorExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public static ApiVersionModel GetApiVersionModel( this HttpControllerDescriptor
3939
throw new ArgumentNullException( nameof( controllerDescriptor ) );
4040
}
4141

42-
if ( controllerDescriptor.Properties.TryGetValue( typeof( ApiVersionModel ), out ApiVersionModel value ) )
42+
if ( controllerDescriptor.Properties.TryGetValue( typeof( ApiVersionModel ), out ApiVersionModel? value ) )
4343
{
44-
return value;
44+
return value!;
4545
}
4646

4747
return ApiVersionModel.Empty;
@@ -107,12 +107,12 @@ internal static IEnumerable<HttpControllerDescriptor> AsEnumerable( this HttpCon
107107
yield return controllerDescriptor;
108108
}
109109

110-
if ( !includeCandidates || !controllerDescriptor.Properties.TryGetValue( PossibleControllerCandidatesKey, out IEnumerable<HttpControllerDescriptor> candidates ) )
110+
if ( !includeCandidates || !controllerDescriptor.Properties.TryGetValue( PossibleControllerCandidatesKey, out IEnumerable<HttpControllerDescriptor>? candidates ) )
111111
{
112112
yield break;
113113
}
114114

115-
foreach ( var candidate in candidates )
115+
foreach ( var candidate in candidates! )
116116
{
117117
if ( visited.Add( candidate ) )
118118
{

src/AspNet/WebApi/src/Asp.Versioning.WebApi/System.Web.Http/HttpRouteExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal static class HttpRouteExtensions
2020

2121
var directRouteActions = default( HttpActionDescriptor[] );
2222

23-
if ( dataTokens.TryGetValue( RouteDataTokenKeys.Actions, out HttpActionDescriptor[] possibleDirectRouteActions ) &&
23+
if ( dataTokens.TryGetValue( RouteDataTokenKeys.Actions, out HttpActionDescriptor[]? possibleDirectRouteActions ) &&
2424
possibleDirectRouteActions != null &&
2525
possibleDirectRouteActions.Length > 0 )
2626
{

src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Conventions/ControllerApiVersionConventionBuilderBase.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Asp.Versioning.Conventions;
44

5-
using Microsoft.AspNetCore.Mvc;
65
using Microsoft.AspNetCore.Mvc.ApplicationModels;
76
using System.Reflection;
87

@@ -50,9 +49,7 @@ public virtual void ApplyTo( ControllerModel item )
5049
/// <param name="method">The <see cref="MethodInfo">method</see> representing the action to retrieve the convention for.</param>
5150
/// <param name="convention">The retrieved <see cref="IApiVersionConvention{T}">convention</see> or <c>null</c>.</param>
5251
/// <returns>True if the convention was successfully retrieved; otherwise, false.</returns>
53-
protected abstract bool TryGetConvention(
54-
MethodInfo method,
55-
[MaybeNullWhen( false )] out IApiVersionConvention<ActionModel> convention );
52+
protected abstract bool TryGetConvention( MethodInfo method, [MaybeNullWhen( false )] out IApiVersionConvention<ActionModel> convention );
5653

5754
private void ApplyActionConventions( ControllerModel controller )
5855
{

src/Common/src/Common.Mvc/Conventions/ActionApiVersionConventionBuilderCollection.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@ protected internal virtual ActionApiVersionConventionBuilder GetOrAdd( MethodInf
6464
/// <param name="actionMethod">The controller action method to get the convention builder for.</param>
6565
/// <param name="actionBuilder">The <see cref="ActionApiVersionConventionBuilder">controller action convention builder</see> or <c>null</c>.</param>
6666
/// <returns>True if the <paramref name="actionBuilder">action builder</paramref> is successfully retrieved; otherwise, false.</returns>
67-
public virtual bool TryGetValue(
68-
MethodInfo? actionMethod,
69-
#if !NETFRAMEWORK
70-
[MaybeNullWhen( false )]
71-
#endif
72-
out ActionApiVersionConventionBuilder actionBuilder )
67+
public virtual bool TryGetValue( MethodInfo? actionMethod, [MaybeNullWhen( false )] out ActionApiVersionConventionBuilder actionBuilder )
7368
{
7469
if ( actionBuilderMappings == null || actionMethod == null )
7570
{

src/Common/src/Common.Mvc/Conventions/ActionApiVersionConventionBuilderCollection{T}.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,7 @@ protected internal virtual ActionApiVersionConventionBuilder<T> GetOrAdd( Method
7373
/// <param name="actionMethod">The controller action method to get the convention builder for.</param>
7474
/// <param name="actionBuilder">The <see cref="ActionApiVersionConventionBuilder{T}">controller action convention builder</see> or <c>null</c>.</param>
7575
/// <returns>True if the <paramref name="actionBuilder">action builder</paramref> is successfully retrieved; otherwise, false.</returns>
76-
public virtual bool TryGetValue(
77-
MethodInfo? actionMethod,
78-
#if !NETFRAMEWORK
79-
[MaybeNullWhen( false )]
80-
#endif
81-
out ActionApiVersionConventionBuilder<T> actionBuilder )
76+
public virtual bool TryGetValue( MethodInfo? actionMethod, [MaybeNullWhen( false )] out ActionApiVersionConventionBuilder<T> actionBuilder )
8277
{
8378
if ( actionBuilderMappings == null || actionMethod == null )
8479
{

src/Common/src/Common.Mvc/Conventions/ControllerApiVersionConventionBuilder.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ public virtual ControllerApiVersionConventionBuilder AdvertisesDeprecatedApiVers
127127
/// <param name="method">The <see cref="MethodInfo">method</see> representing the action to retrieve the convention for.</param>
128128
/// <param name="convention">The retrieved <see cref="IApiVersionConvention{T}">convention</see> or <c>null</c>.</param>
129129
/// <returns>True if the convention was successfully retrieved; otherwise, false.</returns>
130-
protected override bool TryGetConvention(
131-
MethodInfo method,
132-
#if !NETFRAMEWORK
133-
[MaybeNullWhen( false )]
134-
#endif
135-
out IApiVersionConvention<ActionModel> convention )
130+
protected override bool TryGetConvention( MethodInfo method, [MaybeNullWhen( false )] out IApiVersionConvention<ActionModel> convention )
136131
{
137132
if ( actionBuilders is not null &&
138133
actionBuilders.TryGetValue( method, out var actionBuilder ) )

src/Common/src/Common.Mvc/Conventions/ControllerApiVersionConventionBuilder{T}.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@ public virtual ControllerApiVersionConventionBuilder<T> AdvertisesDeprecatedApiV
120120
/// <param name="method">The <see cref="MethodInfo">method</see> representing the action to retrieve the convention for.</param>
121121
/// <param name="convention">The retrieved <see cref="IApiVersionConvention{T}">convention</see> or <c>null</c>.</param>
122122
/// <returns>True if the convention was successfully retrieved; otherwise, false.</returns>
123-
protected override bool TryGetConvention(
124-
MethodInfo method,
125-
#if !NETFRAMEWORK
126-
[MaybeNullWhen( false )]
127-
#endif
128-
out IApiVersionConvention<ActionModel> convention )
123+
protected override bool TryGetConvention( MethodInfo method, [MaybeNullWhen( false )] out IApiVersionConvention<ActionModel> convention )
129124
{
130125
if ( actionBuilders is not null && actionBuilders.TryGetValue( method, out var builder ) )
131126
{

0 commit comments

Comments
 (0)