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

Commit e49fad9

Browse files
committed
Sync changes with version5.
1 parent 1d793a6 commit e49fad9

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Source/LinqToDB.EntityFrameworkCore/Internal/LinqToDBForEFQueryProvider.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,17 @@ IEnumerator IEnumerable.GetEnumerator()
160160
/// <returns>Query result as <see cref="IAsyncEnumerable{T}"/>.</returns>
161161
public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken)
162162
{
163-
return Task.Run(() => QueryProvider.ExecuteAsyncEnumerable<T>(Expression, cancellationToken),
164-
cancellationToken).Result.GetAsyncEnumerator(cancellationToken);
163+
async IAsyncEnumerable<T> EnumerateAsyncEnumerable([EnumeratorCancellation] CancellationToken ct)
164+
{
165+
var asyncEnumerable = await QueryProvider.ExecuteAsyncEnumerable<T>(Expression, ct)
166+
.ConfigureAwait(false);
167+
await foreach (var item in asyncEnumerable.WithCancellation(ct).ConfigureAwait(false))
168+
{
169+
yield return item;
170+
}
171+
}
172+
173+
return EnumerateAsyncEnumerable(cancellationToken).GetAsyncEnumerator(cancellationToken);
165174
}
166175

167176
/// <summary>

Source/LinqToDB.EntityFrameworkCore/LinqToDBForEFToolsDataConnection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public TypeKey(IEntityType entityType, IModel? model)
140140
}
141141

142142
public IEntityType EntityType { get; }
143-
public IModel? Model { get; }
143+
public IModel? Model { get; }
144144

145145
protected bool Equals(TypeKey other)
146146
{
@@ -187,7 +187,7 @@ object IEntityServiceInterceptor.EntityCreated(EntityCreatedEventData eventData,
187187
return entity;
188188

189189
if (!LinqToDBForEFTools.EnableChangeTracker
190-
|| !Tracking
190+
|| !Tracking
191191
|| Context!.ChangeTracker.QueryTrackingBehavior == QueryTrackingBehavior.NoTracking)
192192
return entity;
193193

0 commit comments

Comments
 (0)