Skip to content

Commit

Permalink
Merge pull request #196 from linq2db/version3
Browse files Browse the repository at this point in the history
Release 3.17.0
  • Loading branch information
sdanyliv authored Nov 11, 2021
2 parents 721d427 + af90a7c commit 08d71c5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Build/linq2db.Default.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>3.16.0</Version>
<Version>3.17.0</Version>

<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
<Product>Linq to DB</Product>
Expand Down
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<PackageVersion Include="NUnit" Version="3.13.2" />
<PackageVersion Include="FluentAssertions" Version="5.10.3" />

<PackageVersion Include="linq2db" Version="3.5.0" />
<PackageVersion Include="linq2db.Tools" Version="3.5.0" />
<PackageVersion Include="linq2db" Version="3.5.2" />
<PackageVersion Include="linq2db.Tools" Version="3.5.2" />

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />


<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.11" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.21" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.21" />

<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions NuGet/linq2db.EntityFrameworkCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<license type="file">MIT-LICENSE.txt</license>
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="3.1.11" />
<dependency id="linq2db" version="3.5.0" />
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="3.1.21" />
<dependency id="linq2db" version="3.5.2" />
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace LinqToDB.EntityFrameworkCore.Internal
{
/// <summary>
/// Maps linq2db exression.
/// Maps linq2db expression.
/// </summary>
public class EFCoreExpressionAttribute : Sql.ExpressionAttribute
{
Expand All @@ -20,12 +20,13 @@ public EFCoreExpressionAttribute(string expression) : base(expression)
{
}

/// <inheritdoc cref="Sql.ExpressionAttribute.GetExpression(IDataContext, SelectQuery, System.Linq.Expressions.Expression, Func{Expression, ColumnDescriptor?, ISqlExpression})" />
public override ISqlExpression GetExpression(
/// <inheritdoc/>
public override ISqlExpression? GetExpression<TContext>(
TContext context,
IDataContext dataContext,
SelectQuery query,
Expression expression,
Func<Expression, ColumnDescriptor?, ISqlExpression> converter)
Func<TContext, Expression, ColumnDescriptor?, ISqlExpression> converter)
{
var knownExpressions = new List<Expression>();
if (expression.NodeType == ExpressionType.Call)
Expand All @@ -41,20 +42,20 @@ public override ISqlExpression GetExpression(
knownExpressions.Add(me.Expression!);
}

var pams = new List<ISqlExpression?>(knownExpressions.Select(_ => (ISqlExpression?) null));
var parms = new List<ISqlExpression?>(knownExpressions.Select(_ => (ISqlExpression?) null));

_ = Sql.ExtensionAttribute.ResolveExpressionValues(Expression!,
(v, d) =>
_ = ResolveExpressionValues((context, parms, knownExpressions, converter), Expression!,
static (ctx, v, d) =>
{
var idx = int.Parse(v);
if (pams[idx] == null)
pams[idx] = converter(knownExpressions[idx], null);
if (ctx.parms[idx] == null)
ctx.parms[idx] = ctx.converter(ctx.context, ctx.knownExpressions[idx], null);
return v;
});

var parameters = pams.Select(p => p ?? new SqlExpression("!!!")).ToArray();
var parameters = parms.Select(p => p ?? new SqlExpression("!!!")).ToArray();
return new SqlExpression(expression.Type, Expression!, Precedence, parameters);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ public virtual void LogConnectionTrace(TraceInfo info, ILogger logger)
_ => LogLevel.Trace,
};

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

switch (info.TraceInfoStep)
Expand Down Expand Up @@ -1139,6 +1140,7 @@ public virtual void LogConnectionTrace(TraceInfo info, ILogger logger)
break;
}
}
#pragma warning restore CA1848 // Use the LoggerMessage delegates
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ public async Task TestAsyncMethods([Values(true, false)] bool enableFilter)
{
using (var ctx = CreateContext(enableFilter))
{
#pragma warning disable CA1847 // Use char literal for a single character lookup
var query = ctx.Products.AsQueryable().Where(p => p.ProductName.Contains("a"));
#pragma warning restore CA1847 // Use char literal for a single character lookup

var expectedArray = await query.ToArrayAsync();
var expectedDictionary = await query.ToDictionaryAsync(p => p.ProductId);
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
variables:
solution: 'linq2db.EFCore.sln'
build_configuration: 'Release'
assemblyVersion: 3.16.0
nugetVersion: 3.16.0
assemblyVersion: 3.17.0
nugetVersion: 3.17.0
artifact_nugets: 'nugets'

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

0 comments on commit 08d71c5

Please sign in to comment.