Skip to content

Commit fa0b7ec

Browse files
committed
fixup! Fix breaking API changes inadvertently introduced into the 1.0.1 branch
Only set _currentContext on obsolete path
1 parent c624d11 commit fa0b7ec

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Microsoft.EntityFrameworkCore.Relational/Query/Internal/AsyncGroupJoinInclude.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public virtual void SetPrevious([NotNull] AsyncGroupJoinInclude previous)
6161
"This method is obsolete and will be removed in the 1.1.0 release. Use CreateIncludeContext instead.",
6262
error: true)]
6363
public virtual void Initialize([NotNull] RelationalQueryContext queryContext)
64-
=> CreateIncludeContext(queryContext);
64+
=> _currentContext = CreateIncludeContext(queryContext);
6565

6666
/// <summary>
6767
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
@@ -81,7 +81,7 @@ var asyncGroupJoinIncludeContext
8181
asyncGroupJoinIncludeContext.SetPrevious(_previous.CreateIncludeContext(queryContext));
8282
}
8383

84-
return _currentContext = asyncGroupJoinIncludeContext;
84+
return asyncGroupJoinIncludeContext;
8585
}
8686

8787
/// <summary>
@@ -92,7 +92,7 @@ var asyncGroupJoinIncludeContext
9292
"This method is obsolete and will be removed in the 1.1.0 release. Use IncludeAsync on the object returned by CreateIncludeContext instead.",
9393
error: true)]
9494
public virtual Task IncludeAsync([CanBeNull] object entity, CancellationToken cancellationToken)
95-
=> _currentContext.IncludeAsync(entity, cancellationToken);
95+
=> _currentContext?.IncludeAsync(entity, cancellationToken) ?? Task.FromResult(0);
9696

9797
/// <summary>
9898
/// This API supports the Entity Framework Core infrastructure and is not intended to be used

src/Microsoft.EntityFrameworkCore.Relational/Query/Internal/GroupJoinInclude.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public virtual void SetPrevious([NotNull] GroupJoinInclude previous)
6060
"This method is obsolete and will be removed in the 1.1.0 release. Use CreateIncludeContext instead.",
6161
error: true)]
6262
public virtual void Initialize([NotNull] RelationalQueryContext queryContext)
63-
=> CreateIncludeContext(queryContext);
63+
=> _currentContext = CreateIncludeContext(queryContext);
6464

6565
/// <summary>
6666
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
@@ -80,7 +80,7 @@ var groupJoinIncludeContext
8080
groupJoinIncludeContext.SetPrevious(_previous.CreateIncludeContext(queryContext));
8181
}
8282

83-
return _currentContext = groupJoinIncludeContext;
83+
return groupJoinIncludeContext;
8484
}
8585

8686
/// <summary>
@@ -91,7 +91,7 @@ var groupJoinIncludeContext
9191
"This method is obsolete and will be removed in the 1.1.0 release. Use Include on the object returned by CreateIncludeContext instead.",
9292
error: true)]
9393
public virtual void Include([CanBeNull] object entity)
94-
=> _currentContext.Include(entity);
94+
=> _currentContext?.Include(entity);
9595

9696
/// <summary>
9797
/// This API supports the Entity Framework Core infrastructure and is not intended to be used

0 commit comments

Comments
 (0)