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

Commit 4d166a3

Browse files
authored
Merge pull request #106 from linq2db/version3
Release 3.9.3
2 parents 7f193d9 + 0fb599c commit 4d166a3

File tree

4 files changed

+36
-13
lines changed

4 files changed

+36
-13
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>3.9.2</Version>
3+
<Version>3.9.3</Version>
44

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

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsImplDefault.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,6 @@ static List<Expression> CompactTree(List<Expression> items, ExpressionType nodeT
758758
/// <returns>Transformed expression.</returns>
759759
public virtual Expression TransformExpression(Expression expression, IDataContext dc, DbContext? ctx, IModel? model)
760760
{
761-
var ignoreQueryFilters = false;
762761
var tracking = true;
763762
var ignoreTracking = false;
764763

@@ -807,8 +806,10 @@ TransformInfo LocalTransform(Expression e)
807806

808807
if (generic == IgnoreQueryFiltersMethodInfo)
809808
{
810-
ignoreQueryFilters = true;
811-
isTunnel = true;
809+
var newMethod = Expression.Call(
810+
Methods.LinqToDB.IgnoreFilters.MakeGenericMethod(methodCall.Method.GetGenericArguments()),
811+
methodCall.Arguments[0], Expression.NewArrayInit(typeof(Type)));
812+
return new TransformInfo(newMethod, false, true);
812813
}
813814
else if (generic == AsNoTrackingMethodInfo)
814815
{
@@ -953,13 +954,6 @@ TransformInfo LocalTransform(Expression e)
953954

954955
var newExpression = expression.Transform(e => LocalTransform(e));
955956

956-
if (ignoreQueryFilters)
957-
{
958-
var elementType = newExpression.Type.GetGenericArguments()[0];
959-
newExpression = Expression.Call(Methods.LinqToDB.IgnoreFilters.MakeGenericMethod(elementType),
960-
newExpression, Expression.NewArrayInit(typeof(Type)));
961-
}
962-
963957
if (!ignoreTracking && dc is LinqToDBForEFToolsDataConnection dataConnection)
964958
{
965959
// ReSharper disable once ConditionIsAlwaysTrueOrFalse

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,35 @@ public void TestNullability([Values(true, false)] bool enableFilter)
769769
}
770770

771771

772+
[Test]
773+
public void TestUpdate([Values(true, false)] bool enableFilter)
774+
{
775+
using (var ctx = CreateContext(enableFilter))
776+
{
777+
int? test = 1;
778+
ctx.Employees.IgnoreQueryFilters().Where(e => e.EmployeeId == test).Update(x => new Employee
779+
{
780+
Address = x.Address
781+
782+
});
783+
}
784+
}
785+
786+
[Test]
787+
public async Task TestUpdateAsync([Values(true, false)] bool enableFilter)
788+
{
789+
using (var ctx = CreateContext(enableFilter))
790+
{
791+
int? test = 1;
792+
await ctx.Employees.IgnoreQueryFilters().Where(e => e.EmployeeId == test).UpdateAsync(x => new Employee
793+
{
794+
Address = x.Address
795+
796+
});
797+
}
798+
}
799+
800+
772801
[Test]
773802
public void TestCommandTimeout()
774803
{

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: 3.9.2
5-
nugetVersion: 3.9.2
4+
assemblyVersion: 3.9.3
5+
nugetVersion: 3.9.3
66
artifact_nugets: 'nugets'
77

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

0 commit comments

Comments
 (0)