Skip to content

Commit a9a70bd

Browse files
authored
Merge pull request #97 from AutoMapper/Microsoft.AspNetCore.OData.v8
Supporting Microsoft.AspNetCore.OData v8.0.0-rc.
2 parents de60983 + bb05cea commit a9a70bd

32 files changed

+157
-150
lines changed

AutoMapper.AspNet.OData.EF6/AutoMapper.AspNet.OData.EF6.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
<MinVerTagPrefix>v</MinVerTagPrefix>
1818
</PropertyGroup>
1919

20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
21+
<DefineConstants>TRACE;ASPNET</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
25+
<DefineConstants>TRACE;ASPNET</DefineConstants>
26+
</PropertyGroup>
27+
2028
<ItemGroup>
2129
<Compile Include="..\AutoMapper.AspNetCore.OData.EF6\QueryableExtensions.cs" Link="QueryableExtensions.cs" />
2230
<Compile Include="..\AutoMapper.AspNetCore.OData.EFCore\AsyncSettings.cs" Link="AsyncSettings.cs" />

AutoMapper.AspNet.OData.EF6/ODataQueryOptionsExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.AspNet.OData.Extensions;
22
using Microsoft.AspNet.OData.Query;
3-
using System;
43

54
namespace AutoMapper.AspNet.OData
65
{

AutoMapper.AspNetCore.OData.EF6/AutoMapper.AspNetCore.OData.EF6.csproj

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
55
<RootNamespace>AutoMapper.AspNet.OData</RootNamespace>
66
<PackageId>AutoMapper.AspNetCore.OData.EF6</PackageId>
77
<Description>Creates LINQ expressions from ODataQueryOptions and executes the query.</Description>
88
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
9-
<PackageReleaseNotes>Removing Task.Run form non-async calls. CancellationToken support. Restricting page size Server-side.</PackageReleaseNotes>
9+
<PackageReleaseNotes>Supporting Microsoft.AspNetCore.OData v8.0.0-rc.</PackageReleaseNotes>
1010
<PackageTags>linq expressions odata efcore</PackageTags>
1111
<PackageIconUrl>https://s3.amazonaws.com/automapper/icon.png</PackageIconUrl>
1212
<RepositoryUrl>https://github.com/AutoMapper/AutoMapper.Extensions.OData</RepositoryUrl>
@@ -17,6 +17,22 @@
1717
<MinVerTagPrefix>v</MinVerTagPrefix>
1818
</PropertyGroup>
1919

20+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.1|AnyCPU'">
21+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.1|AnyCPU'">
25+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
26+
</PropertyGroup>
27+
28+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
29+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
30+
</PropertyGroup>
31+
32+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3.1|AnyCPU'">
33+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
34+
</PropertyGroup>
35+
2036
<ItemGroup>
2137
<Compile Include="..\AutoMapper.AspNetCore.OData.EFCore\AsyncSettings.cs" Link="AsyncSettings.cs" />
2238
<Compile Include="..\AutoMapper.AspNetCore.OData.EFCore\Constants.cs" Link="Constants.cs" />
@@ -45,13 +61,17 @@
4561
<PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="[4.1.1,5.0.0)" />
4662
<PackageReference Include="EntityFramework" Version="6.3.0" />
4763
<PackageReference Include="LogicBuilder.Expressions.Utils" Version="[4.1.1,5.0.0)" />
48-
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.4.1" />
64+
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.0-rc" />
4965
<PackageReference Include="MinVer" Version="2.3.0">
5066
<PrivateAssets>all</PrivateAssets>
5167
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5268
</PackageReference>
5369
</ItemGroup>
5470

71+
<ItemGroup>
72+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
73+
</ItemGroup>
74+
5575
<ItemGroup>
5676
<Folder Include="Visitors\" />
5777
<Folder Include="Properties\" />

AutoMapper.AspNetCore.OData.EF6/QueryableExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
using AutoMapper.Extensions.ExpressionMapping;
22
using LogicBuilder.Expressions.Utils.Expansions;
3+
#if ASPNET
34
using Microsoft.AspNet.OData.Query;
5+
#endif
6+
#if ASPNETCORE
7+
using Microsoft.AspNetCore.OData.Query;
8+
#endif
49
using System;
510
using System.Collections.Generic;
611
using System.Data.Entity;
712
using System.Linq;
813
using System.Linq.Expressions;
9-
using System.Text;
1014
using System.Threading;
1115
using System.Threading.Tasks;
1216

AutoMapper.AspNetCore.OData.EFCore/AutoMapper.AspNetCore.OData.EFCore.csproj

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<RootNamespace>AutoMapper.AspNet.OData</RootNamespace>
66
<PackageId>AutoMapper.AspNetCore.OData.EFCore</PackageId>
77
<Description>Creates LINQ expressions from ODataQueryOptions and executes the query.</Description>
88
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
9-
<PackageReleaseNotes>Removing Task.Run form non-async calls. CancellationToken support. Restricting page size Server-side.</PackageReleaseNotes>
9+
<PackageReleaseNotes>Supporting Microsoft.AspNetCore.OData v8.0.0-rc.</PackageReleaseNotes>
1010
<PackageTags>linq expressions odata efcore</PackageTags>
1111
<PackageIconUrl>https://s3.amazonaws.com/automapper/icon.png</PackageIconUrl>
1212
<RepositoryUrl>https://github.com/AutoMapper/AutoMapper.Extensions.OData</RepositoryUrl>
@@ -17,16 +17,28 @@
1717
<MinVerTagPrefix>v</MinVerTagPrefix>
1818
</PropertyGroup>
1919

20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
21+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
25+
<DefineConstants>TRACE;ASPNETCORE</DefineConstants>
26+
</PropertyGroup>
27+
2028
<ItemGroup>
2129
<PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="[4.1.1,5.0.0)" />
2230
<PackageReference Include="LogicBuilder.Expressions.Utils" Version="[4.1.1,5.0.0)" />
23-
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.4.1" />
31+
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.0-rc" />
2432
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
2533
<PackageReference Include="MinVer" Version="2.3.0">
2634
<PrivateAssets>all</PrivateAssets>
2735
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2836
</PackageReference>
2937
</ItemGroup>
38+
39+
<ItemGroup>
40+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
41+
</ItemGroup>
3042

3143
<ItemGroup>
3244
<Compile Update="Properties\Resources.Designer.cs">

AutoMapper.AspNetCore.OData.EFCore/LinqExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
using AutoMapper.AspNet.OData.Visitors;
22
using LogicBuilder.Expressions.Utils;
33
using LogicBuilder.Expressions.Utils.Expansions;
4-
using Microsoft.AspNet.OData.Extensions;
4+
#if ASPNET
55
using Microsoft.AspNet.OData.Query;
6+
#endif
7+
#if ASPNETCORE
8+
using Microsoft.AspNetCore.OData.Query;
9+
#endif
610
using Microsoft.OData.UriParser;
711
using System;
812
using System.Collections.Generic;

AutoMapper.AspNetCore.OData.EFCore/ODataQueryOptionsExtensions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using Microsoft.AspNet.OData.Extensions;
2-
using Microsoft.AspNet.OData.Query;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Text;
1+
using Microsoft.AspNetCore.OData.Extensions;
2+
using Microsoft.AspNetCore.OData.Query;
63

74
namespace AutoMapper.AspNet.OData
85
{
@@ -43,7 +40,7 @@ public static void AddNextLinkOptionsResult(this ODataQueryOptions options, int
4340
if (options.Request == null)
4441
return;
4542

46-
options.Request.ODataFeature().NextLink = options.Request.GetNextPageLink(pageSize);
43+
options.Request.ODataFeature().NextLink = options.Request.GetNextPageLink(pageSize, null, null);
4744
}
4845
}
4946
}

AutoMapper.AspNetCore.OData.EFCore/ODataSettings.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
using Microsoft.AspNet.OData.Query;
1+

2+
#if ASPNET
3+
using Microsoft.AspNet.OData.Query;
4+
#endif
5+
#if ASPNETCORE
6+
using Microsoft.AspNetCore.OData.Query;
7+
#endif
28

39
namespace AutoMapper.AspNet.OData
410
{

AutoMapper.AspNetCore.OData.EFCore/QuerySettings.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Microsoft.AspNet.OData.Query;
2-
3-
namespace AutoMapper.AspNet.OData
1+
namespace AutoMapper.AspNet.OData
42
{
53
/// <summary>
64
/// This class describes the settings to use during query composition.

AutoMapper.AspNetCore.OData.EFCore/QueryableExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using AutoMapper.Extensions.ExpressionMapping;
22
using LogicBuilder.Expressions.Utils.Expansions;
3-
using Microsoft.AspNet.OData.Query;
3+
using Microsoft.AspNetCore.OData.Query;
44
using Microsoft.EntityFrameworkCore;
55
using Microsoft.EntityFrameworkCore.Query;
66
using System;

0 commit comments

Comments
 (0)