Skip to content
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

Delete out of supported target platform and add the latest .net 7 platform #794

Open
wants to merge 1 commit into
base: release-8.x
Choose a base branch
from
Open
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
12 changes: 4 additions & 8 deletions pipelines/azure_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ jobs:
versionSpec: '>=5.2.0'
checkLatest: true
- task: UseDotNet@2
displayName: Use .NET Core sdk 3.1
inputs:
version: 3.x
- task: UseDotNet@2
displayName: Use .NET Core sdk 5.x
displayName: 'Use .NET Core SDK 6.x'
inputs:
version: 5.x
version: 6.x
includePreviewVersions: true
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 6.x'
displayName: Use .NET Core sdk 7.x
inputs:
version: 6.x
version: 7.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Build Microsoft.AspNetCore.OData
Expand Down
12 changes: 4 additions & 8 deletions pipelines/azure_pipelines_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ stages:
versionSpec: '>=5.2.0'
checkLatest: true
- task: UseDotNet@2
displayName: Use .NET Core sdk 3.1
inputs:
version: 3.x
- task: UseDotNet@2
displayName: Use .NET Core sdk 5.x
displayName: 'Use .NET Core SDK 6.x'
inputs:
version: 5.x
version: 6.x
includePreviewVersions: true
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 6.x'
displayName: 'Use .NET Core SDK 7.x'
inputs:
version: 6.x
version: 7.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Build Microsoft.AspNetCore.OData
Expand Down
2 changes: 1 addition & 1 deletion sample/ODataSampleCommon/ODataSampleCommon.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.AspNetCore.OData.NewtonsoftJson.Nightly.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<group targetFramework=".net6.0">
<dependency id="Microsoft.AspNetCore.OData" version="$VersionFullSemantic$-Nightly$NightlyBuildVersion$" />
</group>
<group targetFramework=".net5.0">
<group targetFramework=".net7.0">
<dependency id="Microsoft.AspNetCore.OData" version="$VersionFullSemantic$-Nightly$NightlyBuildVersion$" />
</group>
</dependencies>
Expand All @@ -28,9 +28,9 @@
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net6.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net5.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net7.0" />
<file src="$SourcesRoot$\images\odata.png" target="images\" />
</files>
</package>
10 changes: 5 additions & 5 deletions src/Microsoft.AspNetCore.OData.NewtonsoftJson.Release.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<icon>images\odata.png</icon>
<repository type="git" url="https://github.com/OData/AspNetCoreOData.git" branch="master" />
<dependencies>
<group targetFramework=".net5.0">
<group targetFramework=".net6.0">
<dependency id="Microsoft.AspNetCore.OData" version="$VersionNuGetSemantic$" />
</group>
<group targetFramework=".net6.0">
<group targetFramework=".net7.0">
<dependency id="Microsoft.AspNetCore.OData" version="$VersionNuGetSemantic$" />
</group>
</dependencies>
Expand All @@ -28,9 +28,9 @@
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net6.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net5.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.dll" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.xml" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.NewtonsoftJson.pdb" target="lib\net7.0" />
<file src="$SourcesRoot$\images\odata.png" target="images\" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<RootNamespace>Microsoft.AspNetCore.OData.NewtonsoftJson</RootNamespace>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>

Expand All @@ -16,11 +16,6 @@
<Import Project="..\..\tool\build.props" />

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -31,6 +26,21 @@
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0" >
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.12" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" >
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj" />
</ItemGroup>
Expand Down
23 changes: 7 additions & 16 deletions src/Microsoft.AspNetCore.OData.Nightly.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<package>
<metadata>
<id>Microsoft.AspNetCore.OData</id>
<title>Microsoft ASP.NET Core 3.x, 5.x and 6.x for OData v4.0</title>
<title>Microsoft ASP.NET Core 6.x and 7.x for OData v4.0</title>
<version>$VersionFullSemantic$-Nightly$NightlyBuildVersion$</version>
<authors>OData (.NET Foundation)</authors>
<copyright>&#169; .NET Foundation and Contributors. All rights reserved.</copyright>
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 3.x and 5.x to support OData query syntax for your Web APIs.</description>
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 6.x and 7.x to support OData query syntax for your Web APIs.</description>
<summary>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core.</summary>
<language>en-US</language>
<projectUrl>http://github.com/OData/AspNetCoreOData</projectUrl>
Expand All @@ -16,19 +16,13 @@
<icon>images\odata.png</icon>
<repository type="git" url="https://github.com/OData/AspNetCoreOData.git" branch="master" />
<dependencies>
<group targetFramework=".netcoreapp3.1">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.Spatial" version="$ODataLibPackageDependency$" />
</group>
<group targetFramework=".net5.0">
<group targetFramework=".net6.0">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.Spatial" version="$ODataLibPackageDependency$" />
</group>
<group targetFramework=".net6.0">
<group targetFramework=".net7.0">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
Expand All @@ -37,15 +31,12 @@
</dependencies>
</metadata>
<files>
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.dll" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.xml" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.pdb" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.dll" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.xml" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.pdb" target="lib\net5.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.dll" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.xml" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.pdb" target="lib\net6.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.dll" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.xml" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.pdb" target="lib\net7.0" />
<file src="$SourcesRoot$\images\odata.png" target="images\" />
</files>
</package>
23 changes: 7 additions & 16 deletions src/Microsoft.AspNetCore.OData.Release.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<package>
<metadata>
<id>Microsoft.AspNetCore.OData</id>
<title>Microsoft ASP.NET Core 3.x, 5.x and 6.x for OData v4.0</title>
<title>Microsoft ASP.NET Core 6.x and 7.x for OData v4.0</title>
<version>$VersionNuGetSemantic$</version>
<authors>OData (.NET Foundation)</authors>
<copyright>&#169; .NET Foundation and Contributors. All rights reserved.</copyright>
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 3.x and 5.x to support OData query syntax for your Web APIs.</description>
<description>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 6.x and 7.x to support OData query syntax for your Web APIs.</description>
<summary>This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC.</summary>
<language>en-US</language>
<projectUrl>http://github.com/OData/AspNetCoreOData</projectUrl>
Expand All @@ -16,19 +16,13 @@
<icon>images\odata.png</icon>
<repository type="git" url="https://github.com/OData/AspNetCoreOData.git" branch="master" />
<dependencies>
<group targetFramework=".netcoreapp3.1">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.Spatial" version="$ODataLibPackageDependency$" />
</group>
<group targetFramework=".net5.0">
<group targetFramework=".net6.0">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.Spatial" version="$ODataLibPackageDependency$" />
</group>
<group targetFramework=".net6.0">
<group targetFramework=".net7.0">
<dependency id="Microsoft.OData.ModelBuilder" version="$ODataModelBuilderPackageDependency$" />
<dependency id="Microsoft.OData.Core" version="$ODataLibPackageDependency$" />
<dependency id="Microsoft.OData.Edm" version="$ODataLibPackageDependency$" />
Expand All @@ -37,15 +31,12 @@
</dependencies>
</metadata>
<files>
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.dll" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.xml" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\netcoreapp3.1\Microsoft.AspNetCore.OData.pdb" target="lib\netcoreapp3.1" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.dll" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.xml" target="lib\net5.0" />
<file src="$ProductRoot$\net5.0\Microsoft.AspNetCore.OData.pdb" target="lib\net5.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.dll" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.xml" target="lib\net6.0" />
<file src="$ProductRoot$\net6.0\Microsoft.AspNetCore.OData.pdb" target="lib\net6.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.dll" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.xml" target="lib\net7.0" />
<file src="$ProductRoot$\net7.0\Microsoft.AspNetCore.OData.pdb" target="lib\net7.0" />
<file src="$SourcesRoot$\images\odata.png" target="images\" />
</files>
</package>
2 changes: 0 additions & 2 deletions src/Microsoft.AspNetCore.OData/Common/TypeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static bool IsDateTime(Type clrType)
return Type.GetTypeCode(underlyingTypeOrSelf) == TypeCode.DateTime;
}

#if NET6_0
/// <summary>
/// Determine if a type is a <see cref="DateOnly"/>.
/// </summary>
Expand All @@ -112,7 +111,6 @@ public static bool IsTimeOnly(this Type clrType)
Type underlyingTypeOrSelf = GetUnderlyingTypeOrSelf(clrType);
return underlyingTypeOrSelf == typeof(TimeOnly);
}
#endif

/// <summary>
/// Determine if a type is a TimeSpan.
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.AspNetCore.OData/Edm/DefaultODataTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ static DefaultODataTypeMapper()
BuildValueTypeMapping<char>(EdmPrimitiveTypeKind.String, isStandard: false);
BuildValueTypeMapping<DateTime>(EdmPrimitiveTypeKind.DateTimeOffset, isStandard: false);

#if NET6_0
BuildValueTypeMapping<DateOnly>(EdmPrimitiveTypeKind.Date, isStandard: false);
BuildValueTypeMapping<TimeOnly>(EdmPrimitiveTypeKind.TimeOfDay, isStandard: false);
#endif
}
#endregion

Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.AspNetCore.OData/Edm/EdmPrimitiveHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public static object ConvertPrimitiveValue(object value, Type type, TimeZoneInfo

throw new ValidationException(Error.Format(SRResources.PropertyMustBeBoolean));
}
#if NET6_0
else if (type == typeof(DateOnly))
{
if (value is Date dt)
Expand All @@ -156,7 +155,6 @@ public static object ConvertPrimitiveValue(object value, Type type, TimeZoneInfo

throw new ValidationException(Error.Format(SRResources.PropertyMustBeTimeOfDay));
}
#endif
else
{
if (TypeHelper.TryGetInstance(type, value, out var result))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ internal static object ConvertPrimitiveValue(object value, IEdmPrimitiveTypeRefe
return tod;
}

#if NET6_0
// Since ODL doesn't support "DateOnly", we have to use Date defined in ODL.
if (primitiveType != null && primitiveType.IsDate() && TypeHelper.IsDateOnly(type))
{
Expand All @@ -161,7 +160,6 @@ internal static object ConvertPrimitiveValue(object value, IEdmPrimitiveTypeRefe
TimeOnly timeOnly = (TimeOnly)value;
return new TimeOfDay(timeOnly.Hour, timeOnly.Minute, timeOnly.Second, timeOnly.Millisecond);
}
#endif

return ConvertUnsupportedPrimitives(value, timeZoneInfo);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &gt;= '17.0'">$(TargetFrameworks);net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<RootNamespace>Microsoft.AspNetCore.OData</RootNamespace>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
Expand Down
2 changes: 0 additions & 2 deletions src/Microsoft.AspNetCore.OData/Query/ClrCanonicalFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ internal class ClrCanonicalFunctions
new KeyValuePair<string, PropertyInfo>(MillisecondFunctionName, typeof(TimeOfDay).GetProperty("Milliseconds")),
}.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);

#if NET6_0
// DateOnly properties
public static readonly Dictionary<string, PropertyInfo> DateOnlyProperties = new Dictionary<string, PropertyInfo>
{
Expand All @@ -141,7 +140,6 @@ internal class ClrCanonicalFunctions
{ SecondFunctionName, typeof(TimeOnly).GetProperty(nameof(TimeOnly.Second)) },
{ MillisecondFunctionName, typeof(TimeOnly).GetProperty(nameof(TimeOnly.Millisecond)) }
};
#endif

// TimeSpan properties
public static readonly Dictionary<string, PropertyInfo> TimeSpanProperties = new[]
Expand Down
Loading