Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit e3b3ac4

Browse files
committed
Updated to linq2db 3.5.2
1 parent fb35e11 commit e3b3ac4

File tree

8 files changed

+26
-17
lines changed

8 files changed

+26
-17
lines changed

Build/linq2db.Default.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.3.0</Version>
3+
<Version>2.4.0</Version>
44

55
<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
66
<Product>Linq to DB</Product>

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<PackageVersion Include="NUnit" Version="3.13.2" />
66
<PackageVersion Include="FluentAssertions" Version="5.10.3" />
77

8-
<PackageVersion Include="linq2db" Version="3.5.0" />
9-
<PackageVersion Include="linq2db.Tools" Version="3.5.0" />
8+
<PackageVersion Include="linq2db" Version="3.5.2" />
9+
<PackageVersion Include="linq2db.Tools" Version="3.5.2" />
1010

11-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
11+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
1212
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
1313
<PackageVersion Include="System.Interactive.Async" Version="3.2.0"/>
1414

NuGet/linq2db.EntityFrameworkCore.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependencies>
1717
<group targetFramework=".NETStandard2.0">
1818
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="2.2.6" />
19-
<dependency id="linq2db" version="3.5.0" />
19+
<dependency id="linq2db" version="3.5.2" />
2020
</group>
2121
</dependencies>
2222
</metadata>

Source/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
dotnet_diagnostic.CA1827.severity = error # CA1827: Do not use Count/LongCount when Any can be used
3+
dotnet_diagnostic.CA2007.severity = error # CA2007: Do not directly await a Task
4+
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Enumerable.Count method

Source/LinqToDB.EntityFrameworkCore/Internal/EFCoreExpressionAttribute.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace LinqToDB.EntityFrameworkCore.Internal
99
{
1010
/// <summary>
11-
/// Maps linq2db exression.
11+
/// Maps linq2db expression.
1212
/// </summary>
1313
public class EFCoreExpressionAttribute : Sql.ExpressionAttribute
1414
{
@@ -20,12 +20,13 @@ public EFCoreExpressionAttribute(string expression) : base(expression)
2020
{
2121
}
2222

23-
/// <inheritdoc cref="Sql.ExpressionAttribute.GetExpression(IDataContext, SelectQuery, System.Linq.Expressions.Expression, Func{Expression, ColumnDescriptor?, ISqlExpression})" />
24-
public override ISqlExpression GetExpression(
23+
/// <inheritdoc/>
24+
public override ISqlExpression? GetExpression<TContext>(
25+
TContext context,
2526
IDataContext dataContext,
2627
SelectQuery query,
2728
Expression expression,
28-
Func<Expression, ColumnDescriptor?, ISqlExpression> converter)
29+
Func<TContext, Expression, ColumnDescriptor?, ISqlExpression> converter)
2930
{
3031
var knownExpressions = new List<Expression>();
3132
if (expression.NodeType == ExpressionType.Call)
@@ -41,20 +42,20 @@ public override ISqlExpression GetExpression(
4142
knownExpressions.Add(me.Expression!);
4243
}
4344

44-
var pams = new List<ISqlExpression?>(knownExpressions.Select(_ => (ISqlExpression?) null));
45+
var parms = new List<ISqlExpression?>(knownExpressions.Select(_ => (ISqlExpression?) null));
4546

46-
_ = Sql.ExtensionAttribute.ResolveExpressionValues(Expression!,
47-
(v, d) =>
47+
_ = ResolveExpressionValues((context, parms, knownExpressions, converter), Expression!,
48+
static (ctx, v, d) =>
4849
{
4950
var idx = int.Parse(v);
5051

51-
if (pams[idx] == null)
52-
pams[idx] = converter(knownExpressions[idx], null);
52+
if (ctx.parms[idx] == null)
53+
ctx.parms[idx] = ctx.converter(ctx.context, ctx.knownExpressions[idx], null);
5354

5455
return v;
5556
});
5657

57-
var parameters = pams.Select(p => p ?? new SqlExpression("!!!")).ToArray();
58+
var parameters = parms.Select(p => p ?? new SqlExpression("!!!")).ToArray();
5859
return new SqlExpression(expression.Type, Expression!, Precedence, parameters);
5960
}
6061
}

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsImplDefault.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ public virtual void LogConnectionTrace(TraceInfo info, ILogger logger)
11211121
_ => LogLevel.Trace,
11221122
};
11231123

1124+
#pragma warning disable CA1848 // Use the LoggerMessage delegates
11241125
using var _ = logger.BeginScope("TraceInfoStep: {TraceInfoStep}, IsAsync: {IsAsync}", info.TraceInfoStep, info.IsAsync);
11251126

11261127
switch (info.TraceInfoStep)
@@ -1159,6 +1160,7 @@ public virtual void LogConnectionTrace(TraceInfo info, ILogger logger)
11591160
break;
11601161
}
11611162
}
1163+
#pragma warning restore CA1848 // Use the LoggerMessage delegates
11621164
}
11631165

11641166
/// <summary>

Tests/LinqToDB.EntityFrameworkCore.SqlServer.Tests/ToolsTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ public async Task TestAsyncMethods([Values(true, false)] bool enableFilter)
410410
{
411411
using (var ctx = CreateContext(enableFilter))
412412
{
413+
#pragma warning disable CA1847 // Use char literal for a single character lookup
413414
var query = ctx.Products.AsQueryable().Where(p => p.ProductName.Contains("a"));
415+
#pragma warning restore CA1847 // Use char literal for a single character lookup
414416

415417
var expectedArray = await query.ToArrayAsync();
416418
var expectedDictionary = await query.ToDictionaryAsync(p => p.ProductId);

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
variables:
22
solution: 'linq2db.EFCore.sln'
33
build_configuration: 'Release'
4-
assemblyVersion: 2.3.0
5-
nugetVersion: 2.3.0
4+
assemblyVersion: 2.4.0
5+
nugetVersion: 2.4.0
66
artifact_nugets: 'nugets'
77

88
# build on commits to important branches (master + release branches):

0 commit comments

Comments
 (0)