Skip to content

Commit 44bdc59

Browse files
Merge pull request #43 from StevenRasmussen/v9
V9 release
2 parents bb65717 + 5b22bd7 commit 44bdc59

File tree

5 files changed

+63
-41
lines changed

5 files changed

+63
-41
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ await this.Db.RaceResult
211211
// FROM [RaceResult] AS [r]
212212
// WHERE DATEDIFF_BIG(SECOND, [r].[StartTime], '2019-07-01T00:00:00.0000000Z') >= CAST(100000 AS bigint)
213213
```
214+
* 9.0.0 (Nov 20, 2024)
215+
* Release for EF Core 9
216+
* 9.0.0-rc.1.24451.1 (Sept 27, 2024)
217+
* Release candidate 1 for EF Core 9
214218
* 8.0.1 (April 6, 2024)
215219
* Added support for compiled models - [#39](/../../issues/39)
216220
* 8.0.0 (November 18, 2023)

src/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime.Tests/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime.Tests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
11-
<PackageReference Include="NodaTime" Version="3.1.0" />
12-
<PackageReference Include="xunit" Version="2.6.2" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
11+
<PackageReference Include="NodaTime" Version="3.2.0" />
12+
<PackageReference Include="xunit" Version="2.9.2" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
17-
<PackageReference Include="coverlet.collector" Version="6.0.0">
17+
<PackageReference Include="coverlet.collector" Version="6.0.2">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>

src/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime/Query/ExpressionTranslators/BaseNodaTimeMemberTranslator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public abstract class BaseNodaTimeMemberTranslator : IMemberTranslator
1414
private readonly ISqlExpressionFactory _sqlExpressionFactory;
1515
private readonly Dictionary<string, string> _datePartMapping;
1616
private readonly Type _declaringType;
17+
private static List<bool> _argumentsPropagateNullability = new List<bool>
18+
{
19+
false,
20+
false,
21+
};
1722

1823
public BaseNodaTimeMemberTranslator([NotNull] ISqlExpressionFactory sqlExpressionFactory, [NotNull] Type declaringType, [NotNull] Dictionary<string, string> datePartMapping)
1924
{
@@ -35,7 +40,7 @@ public SqlExpression Translate(SqlExpression instance, MemberInfo member, Type r
3540
"DATEPART",
3641
new[] { _sqlExpressionFactory.Fragment(datePart), instance },
3742
false,
38-
null,
43+
_argumentsPropagateNullability,
3944
returnType);
4045
}
4146
else if (member.Name == nameof(LocalDateTime.Date) && returnType == typeof(LocalDate))

src/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime/Query/ExpressionTranslators/BaseNodaTimeMethodCallTranslator.cs

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ public abstract class BaseNodaTimeMethodCallTranslator : IMethodCallTranslator
1616
private readonly Dictionary<MethodInfo, string> _methodInfoDateDiffMapping;
1717
private readonly Dictionary<MethodInfo, string> _methodInfoDateDiffBigMapping;
1818

19+
private static List<bool> _2argumentsPropagateNullability = new List<bool>
20+
{
21+
false,
22+
false,
23+
};
24+
25+
private static List<bool> _3argumentsPropagateNullability = new List<bool>
26+
{
27+
false,
28+
false,
29+
false,
30+
};
31+
1932
public BaseNodaTimeMethodCallTranslator(
2033
ISqlExpressionFactory sqlExpressionFactory,
2134
Dictionary<MethodInfo, string> methodInfoDateAddMapping,
@@ -41,17 +54,17 @@ public SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadO
4154
|| (sqlConstant.Value is long && ((long)sqlConstant.Value >= int.MaxValue || (long)sqlConstant.Value <= int.MinValue)))
4255
? null
4356
: _sqlExpressionFactory.Function(
44-
"DATEADD",
45-
new[]
57+
name: "DATEADD",
58+
arguments: new[]
4659
{
4760
_sqlExpressionFactory.Fragment(dateAddPart),
4861
_sqlExpressionFactory.Convert(arguments[0], typeof(int)),
4962
instance
5063
},
51-
false,
52-
null,
53-
instance.Type,
54-
instance.TypeMapping);
64+
nullable: false,
65+
argumentsPropagateNullability: _3argumentsPropagateNullability,
66+
returnType: instance.Type,
67+
typeMapping: instance.TypeMapping);
5568
}
5669
else if (_methodInfoDateAddExtensionMapping != null && _methodInfoDateAddExtensionMapping.TryGetValue(method, out var dateAddExtensionPart))
5770
{
@@ -60,31 +73,31 @@ public SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadO
6073
|| (sqlConstant.Value is long && ((long)sqlConstant.Value >= int.MaxValue || (long)sqlConstant.Value <= int.MinValue)))
6174
? null
6275
: _sqlExpressionFactory.Function(
63-
"DATEADD",
64-
new[]
76+
name: "DATEADD",
77+
arguments: new[]
6578
{
6679
_sqlExpressionFactory.Fragment(dateAddExtensionPart),
6780
_sqlExpressionFactory.Convert(arguments[1], typeof(int)),
6881
arguments[0]
6982
},
70-
false,
71-
null,
72-
arguments[0].Type,
73-
arguments[0].TypeMapping);
83+
nullable: false,
84+
argumentsPropagateNullability: _3argumentsPropagateNullability,
85+
returnType: arguments[0].Type,
86+
typeMapping: arguments[0].TypeMapping);
7487
}
7588
else if (_methodInfoDatePartExtensionMapping != null && _methodInfoDatePartExtensionMapping.TryGetValue(method, out var datePart))
7689
{
7790
return _sqlExpressionFactory.Function(
78-
"DATEPART",
79-
new[]
91+
name: "DATEPART",
92+
arguments: new[]
8093
{
8194
_sqlExpressionFactory.Fragment(datePart),
8295
arguments[0]
8396
},
84-
false,
85-
null,
86-
method.ReturnType,
87-
null);
97+
nullable: false,
98+
argumentsPropagateNullability: _2argumentsPropagateNullability,
99+
returnType: method.ReturnType,
100+
typeMapping: null);
88101
}
89102
else if (_methodInfoDateDiffMapping != null && _methodInfoDateDiffMapping.TryGetValue(method, out var dateDiffDatePart))
90103
{
@@ -96,12 +109,12 @@ public SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadO
96109
endDate = _sqlExpressionFactory.ApplyTypeMapping(endDate, typeMapping);
97110

98111
return _sqlExpressionFactory.Function(
99-
"DATEDIFF",
100-
new[] { _sqlExpressionFactory.Fragment(dateDiffDatePart), startDate, endDate },
101-
false,
102-
null,
103-
method.ReturnType,
104-
null);
112+
name: "DATEDIFF",
113+
arguments: new[] { _sqlExpressionFactory.Fragment(dateDiffDatePart), startDate, endDate },
114+
nullable: false,
115+
argumentsPropagateNullability: _3argumentsPropagateNullability,
116+
returnType: method.ReturnType,
117+
typeMapping: null);
105118
}
106119
else if (_methodInfoDateDiffBigMapping != null && _methodInfoDateDiffBigMapping.TryGetValue(method, out var dateDiffBigDatePart))
107120
{
@@ -113,12 +126,12 @@ public SqlExpression Translate(SqlExpression instance, MethodInfo method, IReadO
113126
endDate = _sqlExpressionFactory.ApplyTypeMapping(endDate, typeMapping);
114127

115128
return _sqlExpressionFactory.Function(
116-
"DATEDIFF_BIG",
117-
new[] { _sqlExpressionFactory.Fragment(dateDiffBigDatePart), startDate, endDate },
118-
false,
119-
null,
120-
method.ReturnType,
121-
null);
129+
name: "DATEDIFF_BIG",
130+
arguments: new[] { _sqlExpressionFactory.Fragment(dateDiffBigDatePart), startDate, endDate },
131+
nullable: false,
132+
argumentsPropagateNullability: _3argumentsPropagateNullability,
133+
returnType: method.ReturnType,
134+
typeMapping: null);
122135
}
123136
return null;
124137
}

src/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<PackageProjectUrl>https://github.com/StevenRasmussen/EFCore.SqlServer.NodaTime</PackageProjectUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageTags>Entity Framework Core;entity-framework-core;EF;Data;O/RM;EntityFrameworkCore;EFCore;Noda;NodaTime;Noda Time</PackageTags>
16-
<Version>8.0.1</Version>
16+
<Version>9.0.0</Version>
1717
<PackageReadmeFile>README.md</PackageReadmeFile>
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
22-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
23-
<PackageReference Include="NodaTime" Version="3.1.0" />
21+
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
22+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
23+
<PackageReference Include="NodaTime" Version="3.2.0" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)