Skip to content

Commit 6610886

Browse files
IDE recommendation
1 parent 60f20ae commit 6610886

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/ApiVersionParameterDescriptionContext.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,11 @@ protected virtual void UpdateUrlSegment()
185185
parameter.RouteInfo.DefaultValue = parameter.DefaultValue;
186186
}
187187

188-
if ( parameter.ParameterDescriptor == null )
188+
parameter.ParameterDescriptor ??= new()
189189
{
190-
parameter.ParameterDescriptor = new()
191-
{
192-
Name = parameter.Name,
193-
ParameterType = typeof( ApiVersion ),
194-
};
195-
}
190+
Name = parameter.Name,
191+
ParameterType = typeof( ApiVersion ),
192+
};
196193

197194
RemoveAllParametersExcept( parameter );
198195
}

0 commit comments

Comments
 (0)