Skip to content

Commit

Permalink
Supporting .NET version 9.0. (#56)
Browse files Browse the repository at this point in the history
* Supporting .NET version 9.0.
  • Loading branch information
BlaiseD authored Nov 25, 2024
1 parent 52941fa commit 4fd5037
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 9.x
source-url: https://nuget.pkg.github.com/bpslogicbuilder/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add Telerik Nuget source
run: dotnet nuget add source https://nuget.telerik.com/nuget -n telerik -u ${{ secrets.TELERIK_USERNAME }} -p ${{ secrets.TELERIK_PASSWORD }}
run: dotnet nuget add source https://nuget.telerik.com/v3/index.json -n telerik -u ${{ secrets.TELERIK_USERNAME }} -p ${{ secrets.TELERIK_PASSWORD }}

- name: Add AutoMapper Myget Source
run: dotnet nuget add source https://www.myget.org/F/automapperdev/api/v3/index.json -n automappermyget
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 9.x
source-url: https://nuget.pkg.github.com/bpslogicbuilder/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add Telerik Nuget source
run: dotnet nuget add source https://nuget.telerik.com/nuget -n telerik -u ${{ secrets.TELERIK_USERNAME }} -p ${{ secrets.TELERIK_PASSWORD }}
run: dotnet nuget add source https://nuget.telerik.com/v3/index.json -n telerik -u ${{ secrets.TELERIK_USERNAME }} -p ${{ secrets.TELERIK_PASSWORD }}

- name: Set Variables
run: |
Expand Down
4 changes: 2 additions & 2 deletions LogicBuilder.Data/LogicBuilder.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
</PropertyGroup>

<ItemGroup>
<None Include="docs\README.md" Pack="true" PackagePath="\"/>
<None Include="docs\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.3.0">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions LogicBuilder.Domain/LogicBuilder.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
</PropertyGroup>

<ItemGroup>
<None Include="docs\README.md" Pack="true" PackagePath="\"/>
<None Include="docs\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.3.0">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<RootNamespace>LogicBuilder.EntityFrameworkCore.SqlServer</RootNamespace>
<PackageId>LogicBuilder.EntityFrameworkCore.SqlServer</PackageId>
<Authors>BlaiseD</Authors>
<Description>Given an EF Core DBContext, LogicBuilder.EntityFrameworkCore.SqlServer uses AutoMapper configurations to support CRUD operations using the DTO objects.</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>Bug fix: Allow delete after updating an entity.</PackageReleaseNotes>
<PackageReleaseNotes>Supporting .NET 9.0.</PackageReleaseNotes>
<PackageTags>crud operations efcore</PackageTags>
<Copyright>Copyright © BPS 2017</Copyright>
<RepositoryUrl>https://github.com/BpsLogicBuilder/LogicBuilder.DataComponents</RepositoryUrl>
Expand All @@ -22,31 +22,27 @@
</PropertyGroup>

<ItemGroup>
<None Include="docs\README.md" Pack="true" PackagePath="\"/>
<None Include="docs\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="[7.0.0,8.0.0)" />
<PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="[7.0.2,8.0.0)" />
<PackageReference Include="LogicBuilder.Data" Version="6.0.3" />
<PackageReference Include="LogicBuilder.Domain" Version="6.0.3" />
<PackageReference Include="LogicBuilder.Expressions.Utils" Version="6.0.3" />
<PackageReference Include="MinVer" Version="4.3.0">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

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

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

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<RootNamespace>LogicBuilder.Expressions.EntityFrameworkCore</RootNamespace>
<PackageId>LogicBuilder.Expressions.EntityFrameworkCore</PackageId>
<Authors>BlaiseD</Authors>
Expand All @@ -22,28 +22,24 @@
</PropertyGroup>

<ItemGroup>
<None Include="docs\README.md" Pack="true" PackagePath="\"/>
<None Include="docs\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="LogicBuilder.Expressions.Utils" Version="6.0.3" />
<PackageReference Include="MinVer" Version="4.3.0">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</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 Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.2" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Contoso.Data.Entities;
using LogicBuilder.Expressions.Utils.ExpressionBuilder;
using LogicBuilder.Expressions.Utils.ExpressionBuilder.Arithmetic;
using LogicBuilder.Expressions.Utils.ExpressionBuilder.Cacnonical;
using LogicBuilder.Expressions.Utils.ExpressionBuilder.Collection;
using LogicBuilder.Expressions.Utils.ExpressionBuilder.Lambda;
Expand All @@ -9,7 +8,6 @@
using LogicBuilder.Expressions.Utils.Tests.Data;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using Xunit;
Expand Down
4 changes: 3 additions & 1 deletion LogicBuilder.Expressions.Utils/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ public struct AttributeNames
public const string PROPERTYSOURCEPARAMETER = "propertySourceParameter";
}

public struct NET6OnlyLiteralTypeNames
public struct UnreferencedLiteralTypeNames
{
public const string DATEONLY = "System.DateOnly";
public const string TIMEONLY = "System.TimeOnly";
public const string DATE = "Microsoft.OData.Edm.Date";
public const string TIMEOFDAY = "Microsoft.OData.Edm.TimeOfDay";
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.OData.Edm;
using System;
using System;
using System.Linq.Expressions;

namespace LogicBuilder.Expressions.Utils.ExpressionBuilder.DateTimeOperators
Expand All @@ -21,8 +20,8 @@ private Expression Build(Expression operandExpression)

if (operandExpression.Type != typeof(DateTimeOffset)
&& operandExpression.Type != typeof(DateTime)
&& operandExpression.Type != typeof(Date)
&& operandExpression.Type.FullName != NET6OnlyLiteralTypeNames.DATEONLY)
&& operandExpression.Type.FullName != UnreferencedLiteralTypeNames.DATE
&& operandExpression.Type.FullName != UnreferencedLiteralTypeNames.DATEONLY)
return operandExpression;

return Expression.Add
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.OData.Edm;
using System;
using System;
using System.Linq.Expressions;

namespace LogicBuilder.Expressions.Utils.ExpressionBuilder.DateTimeOperators
Expand All @@ -22,8 +21,8 @@ private Expression Build(Expression operandExpression)
if (operandExpression.Type != typeof(DateTimeOffset)
&& operandExpression.Type != typeof(DateTime)
&& operandExpression.Type != typeof(TimeSpan)
&& operandExpression.Type != typeof(TimeOfDay)
&& operandExpression.Type.FullName != NET6OnlyLiteralTypeNames.TIMEONLY)
&& operandExpression.Type.FullName != UnreferencedLiteralTypeNames.TIMEOFDAY
&& operandExpression.Type.FullName != UnreferencedLiteralTypeNames.TIMEONLY)
return operandExpression;

return Expression.Add
Expand Down
29 changes: 14 additions & 15 deletions LogicBuilder.Expressions.Utils/LinqHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using LogicBuilder.Expressions.Utils.ExpressionBuilder;
using LogicBuilder.Expressions.Utils.ExpressionBuilder.Lambda;
using LogicBuilder.Expressions.Utils.Strutures;
using Microsoft.OData.Edm;
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down Expand Up @@ -214,8 +213,8 @@ public static Expression MakeDaySelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTime)
|| operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(Date)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.DATEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATE
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATEONLY)
return operandExpression.MakeSelector("Day");
else
throw new ArgumentException(nameof(operandExpression));
Expand All @@ -227,8 +226,8 @@ public static Expression MakeMonthSelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTime)
|| operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(Date)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.DATEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATE
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATEONLY)
return operandExpression.MakeSelector("Month");
else
throw new ArgumentException(nameof(operandExpression));
Expand All @@ -240,8 +239,8 @@ public static Expression MakeYearSelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTime)
|| operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(Date)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.DATEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATE
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.DATEONLY)
return operandExpression.MakeSelector("Year");
else
throw new ArgumentException(nameof(operandExpression));
Expand All @@ -253,12 +252,12 @@ public static Expression MakeHourSelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(DateTime)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.TIMEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEONLY)
{
return operandExpression.MakeSelector("Hour");
}
else if (operandExpression.Type == typeof(TimeSpan)
|| operandExpression.Type == typeof(TimeOfDay))
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEOFDAY)
{
return operandExpression.MakeSelector("Hours");
}
Expand All @@ -272,12 +271,12 @@ public static Expression MakeMinuteSelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(DateTime)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.TIMEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEONLY)
{
return operandExpression.MakeSelector("Minute");
}
else if (operandExpression.Type == typeof(TimeSpan)
|| operandExpression.Type == typeof(TimeOfDay))
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEOFDAY)
{
return operandExpression.MakeSelector("Minutes");
}
Expand All @@ -291,12 +290,12 @@ public static Expression MakeSecondSelector(this Expression operandExpression)

if (operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(DateTime)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.TIMEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEONLY)
{
return operandExpression.MakeSelector("Second");
}
else if (operandExpression.Type == typeof(TimeSpan)
|| operandExpression.Type == typeof(TimeOfDay))
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEOFDAY)
{
return operandExpression.MakeSelector("Seconds");
}
Expand All @@ -310,12 +309,12 @@ public static Expression MakeMillisecondSelector(this Expression operandExpressi

if (operandExpression.Type == typeof(DateTimeOffset)
|| operandExpression.Type == typeof(DateTime)
|| operandExpression.Type.FullName == NET6OnlyLiteralTypeNames.TIMEONLY)
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEONLY)
{
return operandExpression.MakeSelector("Millisecond");
}
else if (operandExpression.Type == typeof(TimeSpan)
|| operandExpression.Type == typeof(TimeOfDay))
|| operandExpression.Type.FullName == UnreferencedLiteralTypeNames.TIMEOFDAY)
{
return operandExpression.MakeSelector("Milliseconds");
}
Expand Down
Loading

0 comments on commit 4fd5037

Please sign in to comment.