Skip to content

Commit

Permalink
fixup! Fix breaking API changes inadvertently introduced into the 1.0…
Browse files Browse the repository at this point in the history
….1 branch

Only set _currentContext on obsolete path
  • Loading branch information
bricelam committed Aug 30, 2016
1 parent c624d11 commit fa0b7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public virtual void SetPrevious([NotNull] AsyncGroupJoinInclude previous)
"This method is obsolete and will be removed in the 1.1.0 release. Use CreateIncludeContext instead.",
error: true)]
public virtual void Initialize([NotNull] RelationalQueryContext queryContext)
=> CreateIncludeContext(queryContext);
=> _currentContext = CreateIncludeContext(queryContext);

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

return _currentContext = asyncGroupJoinIncludeContext;
return asyncGroupJoinIncludeContext;
}

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

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public virtual void SetPrevious([NotNull] GroupJoinInclude previous)
"This method is obsolete and will be removed in the 1.1.0 release. Use CreateIncludeContext instead.",
error: true)]
public virtual void Initialize([NotNull] RelationalQueryContext queryContext)
=> CreateIncludeContext(queryContext);
=> _currentContext = CreateIncludeContext(queryContext);

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

return _currentContext = groupJoinIncludeContext;
return groupJoinIncludeContext;
}

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

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

0 comments on commit fa0b7ec

Please sign in to comment.