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

Commit 07bb922

Browse files
committed
Sync changes between versions.
1 parent e18d5a6 commit 07bb922

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
using System.Threading.Tasks;
99

1010
using Microsoft.EntityFrameworkCore.Query;
11-
using Microsoft.EntityFrameworkCore.Query.Internal;
12-
13-
using JetBrains.Annotations;
1411
using LinqToDB.Expressions;
1512

1613
namespace LinqToDB.EntityFrameworkCore.Internal
@@ -24,7 +21,7 @@ namespace LinqToDB.EntityFrameworkCore.Internal
2421
/// It may change or be removed without further notice.
2522
/// </summary>
2623
/// <typeparam name="T">Type of query element.</typeparam>
27-
public class LinqToDBForEFQueryProvider<T> : IAsyncQueryProvider, IQueryProviderAsync, IQueryable<T>, System.Collections.Generic.IAsyncEnumerable<T>
24+
public class LinqToDBForEFQueryProvider<T> : IAsyncQueryProvider, IQueryProviderAsync, IQueryable<T>, IAsyncEnumerable<T>
2825
{
2926
/// <summary>
3027
/// Creates instance of adapter.
@@ -84,7 +81,7 @@ public TResult Execute<TResult>(Expression expression)
8481
return QueryProvider.Execute<TResult>(expression);
8582
}
8683

87-
private static MethodInfo _executeAsyncMethodInfo =
84+
private static readonly MethodInfo _executeAsyncMethodInfo =
8885
MemberHelper.MethodOf((IQueryProviderAsync p) => p.ExecuteAsync<int>(null!, default)).GetGenericMethodDefinition();
8986

9087
/// <summary>

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,33 @@ public void TestNullability([Values(true, false)] bool enableFilter)
773773
}
774774
}
775775

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

777804
[Test]
778805
public void TestCommandTimeout()

0 commit comments

Comments
 (0)