Skip to content

Commit

Permalink
Merge pull request #195 from linq2db/version2
Browse files Browse the repository at this point in the history
Release 2.4.0
  • Loading branch information
sdanyliv authored Nov 11, 2021
2 parents 1e6fec6 + e3b3ac4 commit 0c89973
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 17 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>2.3.0</Version>
<Version>2.4.0</Version>

<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
<Product>Linq to DB</Product>
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<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="System.Interactive.Async" Version="3.2.0"/>

Expand Down
2 changes: 1 addition & 1 deletion NuGet/linq2db.EntityFrameworkCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="2.2.6" />
<dependency id="linq2db" version="3.5.0" />
<dependency id="linq2db" version="3.5.2" />
</group>
</dependencies>
</metadata>
Expand Down
4 changes: 4 additions & 0 deletions Source/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]
dotnet_diagnostic.CA1827.severity = error # CA1827: Do not use Count/LongCount when Any can be used
dotnet_diagnostic.CA2007.severity = error # CA2007: Do not directly await a Task
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Enumerable.Count method
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 @@ -1121,6 +1121,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 @@ -1159,6 +1160,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 @@ -410,7 +410,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: 2.3.0
nugetVersion: 2.3.0
assemblyVersion: 2.4.0
nugetVersion: 2.4.0
artifact_nugets: 'nugets'

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

0 comments on commit 0c89973

Please sign in to comment.