Skip to content

Commit f45d9fb

Browse files
Fix new code analysis violations
1 parent 592559c commit f45d9fb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/ApiExplorer/ODataApiExplorerOptionsFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ private static ODataApiVersionCollectionProvider CollateApiVersions(
107107

108108
private sealed class ODataApiVersionCollectionProvider : IODataApiVersionCollectionProvider
109109
{
110-
required public IReadOnlyList<ApiVersion> ApiVersions { get; set; }
110+
public required IReadOnlyList<ApiVersion> ApiVersions { get; set; }
111111
}
112112
}

src/Client/src/Asp.Versioning.Http.Client/ApiVersionHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ApiVersionHandler(
3030
ApiVersion apiVersion,
3131
IApiNotification? notification = default,
3232
IApiVersionParser? parser = default,
33-
ApiVersionHeaderEnumerable? enumerable = default)
33+
ApiVersionHeaderEnumerable? enumerable = default )
3434
{
3535
this.apiVersionWriter = apiVersionWriter ?? throw new ArgumentNullException( nameof( apiVersionWriter ) );
3636
this.apiVersion = apiVersion ?? throw new ArgumentNullException( nameof( apiVersion ) );
@@ -75,7 +75,7 @@ protected virtual bool IsDeprecatedApi( HttpResponseMessage response )
7575
foreach ( var reportedApiVersion in enumerable.Deprecated( response, parser ) )
7676
{
7777
// don't use '==' operator because a derived type may not overload it
78-
if ( apiVersion.CompareTo( reportedApiVersion ) == 0 )
78+
if ( apiVersion.Equals( reportedApiVersion ) )
7979
{
8080
return true;
8181
}

src/Common/src/Common.OData.ApiExplorer/OData/ODataValue{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ public class ODataValue<T>
2323
#if NETFRAMEWORK
2424
public T Value { get; set; } = default!;
2525
#else
26-
required public T Value { get; set; }
26+
public required T Value { get; set; }
2727
#endif
2828
}

src/Common/src/Common.OData/OData/ODataId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public class ODataId
2121
#if NETFRAMEWORK
2222
public Uri Value { get; set; } = default!;
2323
#else
24-
required public Uri Value { get; set; }
24+
public required Uri Value { get; set; }
2525
#endif
2626
}

0 commit comments

Comments
 (0)