From ce6fb51009b7ef5a471abbdd67970d3b9e8e284c Mon Sep 17 00:00:00 2001 From: Arabela Paslaru Date: Mon, 2 Sep 2024 13:33:56 +0300 Subject: [PATCH] Add support for odata v9 --- examples/AspNetCore/OData/Directory.Build.props | 2 +- .../Asp.Versioning.Abstractions.csproj | 4 ++-- .../ApiExplorer/ODataApiDescriptionProvider.cs | 6 ++++++ .../Asp.Versioning.OData.ApiExplorer.csproj | 4 ++-- .../src/Asp.Versioning.OData/Asp.Versioning.OData.csproj | 6 +++--- .../src/Asp.Versioning.Http/Asp.Versioning.Http.csproj | 4 ++-- .../Asp.Versioning.Mvc.ApiExplorer.csproj | 4 ++-- .../WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj | 4 ++-- .../Asp.Versioning.Http.Client.csproj | 4 ++-- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/examples/AspNetCore/OData/Directory.Build.props b/examples/AspNetCore/OData/Directory.Build.props index 302bad37..bf8f78ba 100644 --- a/examples/AspNetCore/OData/Directory.Build.props +++ b/examples/AspNetCore/OData/Directory.Build.props @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/src/Abstractions/src/Asp.Versioning.Abstractions/Asp.Versioning.Abstractions.csproj b/src/Abstractions/src/Asp.Versioning.Abstractions/Asp.Versioning.Abstractions.csproj index 68dd7991..087b29c1 100644 --- a/src/Abstractions/src/Asp.Versioning.Abstractions/Asp.Versioning.Abstractions.csproj +++ b/src/Abstractions/src/Asp.Versioning.Abstractions/Asp.Versioning.Abstractions.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework);netstandard1.0;netstandard2.0 API Versioning Abstractions The abstractions library for API versioning. diff --git a/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/ApiExplorer/ODataApiDescriptionProvider.cs b/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/ApiExplorer/ODataApiDescriptionProvider.cs index fdb4ff8d..6b1cfc70 100644 --- a/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/ApiExplorer/ODataApiDescriptionProvider.cs +++ b/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/ApiExplorer/ODataApiDescriptionProvider.cs @@ -167,6 +167,7 @@ protected virtual void ExploreQueryOptions( IEnumerable apiDescr { var localODataOptions = ODataOptions; var localQueryOptions = Options.QueryOptions; +#pragma warning disable CS0618 // Type or member is obsolete var settings = new ODataQueryOptionSettings() { NoDollarPrefix = localODataOptions.EnableNoDollarQueryOptions, @@ -174,6 +175,7 @@ protected virtual void ExploreQueryOptions( IEnumerable apiDescr DefaultQuerySettings = localODataOptions.QuerySettings, ModelMetadataProvider = ModelMetadataProvider, }; +#pragma warning restore CS0618 // Type or member is obsolete localQueryOptions.ApplyTo( apiDescriptions, settings ); } @@ -309,10 +311,14 @@ private void ExpandNavigationPropertyLinks( switch ( template[i] ) { case EntitySetSegmentTemplate segment: +#pragma warning disable CS0618 // Type or member is obsolete entity = segment.EntitySet.EntityType(); +#pragma warning restore CS0618 // Type or member is obsolete break; case SingletonSegmentTemplate segment: +#pragma warning disable CS0618 // Type or member is obsolete entity = segment.Singleton.EntityType(); +#pragma warning restore CS0618 // Type or member is obsolete break; } } diff --git a/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/Asp.Versioning.OData.ApiExplorer.csproj b/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/Asp.Versioning.OData.ApiExplorer.csproj index c78ccdc9..b48fd3f8 100644 --- a/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/Asp.Versioning.OData.ApiExplorer.csproj +++ b/src/AspNetCore/OData/src/Asp.Versioning.OData.ApiExplorer/Asp.Versioning.OData.ApiExplorer.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework) Asp.Versioning ASP.NET Core API Versioning API Explorer for OData v4.0 diff --git a/src/AspNetCore/OData/src/Asp.Versioning.OData/Asp.Versioning.OData.csproj b/src/AspNetCore/OData/src/Asp.Versioning.OData/Asp.Versioning.OData.csproj index cec744b0..828a0108 100644 --- a/src/AspNetCore/OData/src/Asp.Versioning.OData/Asp.Versioning.OData.csproj +++ b/src/AspNetCore/OData/src/Asp.Versioning.OData/Asp.Versioning.OData.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework) Asp.Versioning ASP.NET Core API Versioning with OData v4.0 @@ -15,7 +15,7 @@ - + diff --git a/src/AspNetCore/WebApi/src/Asp.Versioning.Http/Asp.Versioning.Http.csproj b/src/AspNetCore/WebApi/src/Asp.Versioning.Http/Asp.Versioning.Http.csproj index 3abd2a2c..5560e915 100644 --- a/src/AspNetCore/WebApi/src/Asp.Versioning.Http/Asp.Versioning.Http.csproj +++ b/src/AspNetCore/WebApi/src/Asp.Versioning.Http/Asp.Versioning.Http.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework) Asp.Versioning ASP.NET Core API Versioning diff --git a/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/Asp.Versioning.Mvc.ApiExplorer.csproj b/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/Asp.Versioning.Mvc.ApiExplorer.csproj index 528a203a..e97b3257 100644 --- a/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/Asp.Versioning.Mvc.ApiExplorer.csproj +++ b/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc.ApiExplorer/Asp.Versioning.Mvc.ApiExplorer.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework) Asp.Versioning.ApiExplorer ASP.NET Core API Versioning API Explorer diff --git a/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj b/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj index 52963338..63cd8dac 100644 --- a/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj +++ b/src/AspNetCore/WebApi/src/Asp.Versioning.Mvc/Asp.Versioning.Mvc.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework) Asp.Versioning ASP.NET Core API Versioning diff --git a/src/Client/src/Asp.Versioning.Http.Client/Asp.Versioning.Http.Client.csproj b/src/Client/src/Asp.Versioning.Http.Client/Asp.Versioning.Http.Client.csproj index b704593d..b0234db6 100644 --- a/src/Client/src/Asp.Versioning.Http.Client/Asp.Versioning.Http.Client.csproj +++ b/src/Client/src/Asp.Versioning.Http.Client/Asp.Versioning.Http.Client.csproj @@ -1,8 +1,8 @@  - 8.1.0 - 8.1.0.0 + 9.0.0 + 9.0.0.0 $(DefaultTargetFramework);netstandard1.1;netstandard2.0 Asp.Versioning.Http API Versioning Client Extensions