Skip to content

Commit

Permalink
Removing references to net5.0. (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaiseD committed Aug 19, 2023
1 parent 8e522ea commit 68ff04d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 43 deletions.
4 changes: 0 additions & 4 deletions AutoMapper.AspNetCore.OData.EFCore/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ internal static class Constants
typeof(DateTimeOffset),
typeof(DateTime),
typeof(Date),
#if NET6_0 || NET7_0
typeof(DateOnly)
#endif
};

public static HashSet<Type> DateTimeRelatedTypes = new()
Expand All @@ -24,10 +22,8 @@ internal static class Constants
typeof(DateTime),
typeof(TimeSpan),
typeof(TimeOfDay),
#if NET6_0 || NET7_0
typeof(TimeOnly),
typeof(DateOnly),
#endif
typeof(Date)
};

Expand Down
8 changes: 0 additions & 8 deletions AutoMapper.AspNetCore.OData.EFCore/FilterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,12 @@ private bool ShouldConvertToNumericDate(BinaryOperatorNode binaryOperatorNode)

static bool ShouldConvert(Type leftType, Type rightType)
=> BothTypesDateRelated(leftType, rightType)
#if NET6_0 || NET7_0
&& (
leftType == typeof(Date)
|| rightType == typeof(Date)
|| leftType == typeof(DateOnly)
|| rightType == typeof(DateOnly)
);
#else
&& (leftType == typeof(Date) || rightType == typeof(Date));
#endif
}

private bool ShouldConvertToNumericTime(BinaryOperatorNode binaryOperatorNode)
Expand All @@ -740,16 +736,12 @@ private bool ShouldConvertToNumericTime(BinaryOperatorNode binaryOperatorNode)

static bool ShouldConvert(Type leftType, Type rightType)
=> BothTypesDateTimeRelated(leftType, rightType)
#if NET6_0 || NET7_0
&& (
leftType == typeof(TimeOfDay)
|| rightType == typeof(TimeOfDay)
|| leftType == typeof(TimeOnly)
|| rightType == typeof(TimeOnly)
);
#else
&& (leftType == typeof(TimeOfDay) || rightType == typeof(TimeOfDay));
#endif
}

public IExpressionPart GetConstantOperandFilterPart(ConstantNode constantNode)
Expand Down
14 changes: 5 additions & 9 deletions DAL.EFCore/DAL.EFCore.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
</ItemGroup>

</Project>
22 changes: 11 additions & 11 deletions MigrationTool/MigrationTool.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DAL.EFCore\DAL.EFCore.csproj" />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MigrationTool/Migrations/20200918094359_initial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace MigrationTool.Migrations
{
public partial class initial : Migration
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down
18 changes: 9 additions & 9 deletions SeedDatabase/SeedDatabase.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DAL.EFCore\DAL.EFCore.csproj" />
Expand Down

0 comments on commit 68ff04d

Please sign in to comment.