Skip to content

Commit

Permalink
Fix breaking API changes inadvertently introduced into the 1.0.1 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bricelam committed Aug 30, 2016
1 parent bd45e7d commit c624d11
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ config.test.json
*.sln.iml
*.DotSettings
.idea.*
.cr/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,7 @@ protected virtual string GetColumnType(

var keyOrIndex = false;

// Any property that maps to the column will work because model validator has
// checked that all properties result in the same type mapping.
var property = FindProperties(model, schema, table, name)?.FirstOrDefault();
var property = FindProperty(model, schema, table, name);
if (property != null)
{
// TODO: Allow unicode to be overridden with #3420
Expand Down Expand Up @@ -856,13 +854,15 @@ protected virtual IEnumerable<IEntityType> FindEntityTypes(
=> model?.GetEntityTypes().Where(
t => (_annotations.For(t).TableName == tableName) && (_annotations.For(t).Schema == schema));

protected virtual IEnumerable<IProperty> FindProperties(
protected virtual IProperty FindProperty(
[CanBeNull] IModel model,
[CanBeNull] string schema,
[NotNull] string tableName,
[NotNull] string columnName)
// Any property that maps to the column will work because model validator has
// checked that all properties result in the same column definition.
=> FindEntityTypes(model, schema, tableName)?.SelectMany(e => e.GetDeclaredProperties())
.Where(p => _annotations.For(p).ColumnName == columnName);
.FirstOrDefault(p => _annotations.For(p).ColumnName == columnName);

protected virtual void EndStatement(
[NotNull] MigrationCommandListBuilder builder,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ public async Task<bool> MoveNext(CancellationToken cancellationToken)

if (_sourceEnumerator == null)
{
outerGroupJoinIncludeContext = _groupJoinAsyncEnumerable._outerGroupJoinInclude?.Initialize(_groupJoinAsyncEnumerable._queryContext);
innerGroupJoinIncludeContext = _groupJoinAsyncEnumerable._innerGroupJoinInclude?.Initialize(_groupJoinAsyncEnumerable._queryContext);
outerGroupJoinIncludeContext = _groupJoinAsyncEnumerable._outerGroupJoinInclude?.CreateIncludeContext(_groupJoinAsyncEnumerable._queryContext);
innerGroupJoinIncludeContext = _groupJoinAsyncEnumerable._innerGroupJoinInclude?.CreateIncludeContext(_groupJoinAsyncEnumerable._queryContext);
_sourceEnumerator = _groupJoinAsyncEnumerable._source.GetEnumerator();
_hasNext = await _sourceEnumerator.MoveNext(cancellationToken);
_nextOuter = default(TOuter);
Expand Down Expand Up @@ -577,7 +577,7 @@ await queryContext.QueryBuffer
/// <summary>
/// The create reference related entities loader method.
/// </summary>
public virtual MethodInfo CreateReferenceRelatedEntitiesLoaderMethod
public virtual MethodInfo CreateReferenceRelatedEntitiesLoaderMethod
=> _createReferenceRelatedEntitiesLoaderMethod;

private static readonly MethodInfo _createReferenceRelatedEntitiesLoaderMethod
Expand Down Expand Up @@ -669,7 +669,7 @@ public void Dispose()
/// <summary>
/// The create collection related entities loader method.
/// </summary>
public virtual MethodInfo CreateCollectionRelatedEntitiesLoaderMethod
public virtual MethodInfo CreateCollectionRelatedEntitiesLoaderMethod
=> _createCollectionRelatedEntitiesLoaderMethod;

private static readonly MethodInfo _createCollectionRelatedEntitiesLoaderMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Microsoft.EntityFrameworkCore.Query.Internal
{
/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public class AsyncGroupJoinInclude : IDisposable
Expand All @@ -22,9 +22,10 @@ public class AsyncGroupJoinInclude : IDisposable
private readonly bool _querySourceRequiresTracking;

private AsyncGroupJoinInclude _previous;
private AsyncGroupJoinIncludeContext _currentContext;

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public AsyncGroupJoinInclude(
Expand Down Expand Up @@ -52,12 +53,21 @@ public virtual void SetPrevious([NotNull] AsyncGroupJoinInclude previous)
_previous = previous;
}
}
/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[Obsolete(
"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);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual AsyncGroupJoinIncludeContext Initialize([NotNull] RelationalQueryContext queryContext)
public virtual AsyncGroupJoinIncludeContext CreateIncludeContext([NotNull] RelationalQueryContext queryContext)
{
var asyncGroupJoinIncludeContext
= new AsyncGroupJoinIncludeContext(
Expand All @@ -68,19 +78,29 @@ var asyncGroupJoinIncludeContext

if (_previous != null)
{
asyncGroupJoinIncludeContext.SetPrevious(_previous.Initialize(queryContext));
asyncGroupJoinIncludeContext.SetPrevious(_previous.CreateIncludeContext(queryContext));
}

return asyncGroupJoinIncludeContext;
return _currentContext = asyncGroupJoinIncludeContext;
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[Obsolete(
"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);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual void Dispose()
{
// no-op
_currentContext?.Dispose();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.EntityFrameworkCore.Query.Internal
{
/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public class GroupJoinInclude : IDisposable
Expand All @@ -20,9 +20,10 @@ public class GroupJoinInclude : IDisposable
private readonly bool _querySourceRequiresTracking;

private GroupJoinInclude _previous;
private GroupJoinIncludeContext _currentContext;

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public GroupJoinInclude(
Expand All @@ -36,7 +37,7 @@ public GroupJoinInclude(
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual void SetPrevious([NotNull] GroupJoinInclude previous)
Expand All @@ -52,10 +53,20 @@ public virtual void SetPrevious([NotNull] GroupJoinInclude previous)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual GroupJoinIncludeContext Initialize([NotNull] RelationalQueryContext queryContext)
[Obsolete(
"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);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual GroupJoinIncludeContext CreateIncludeContext([NotNull] RelationalQueryContext queryContext)
{
var groupJoinIncludeContext
= new GroupJoinIncludeContext(
Expand All @@ -66,19 +77,29 @@ var groupJoinIncludeContext

if (_previous != null)
{
groupJoinIncludeContext.SetPrevious(_previous.Initialize(queryContext));
groupJoinIncludeContext.SetPrevious(_previous.CreateIncludeContext(queryContext));
}

return groupJoinIncludeContext;
return _currentContext = groupJoinIncludeContext;
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[Obsolete(
"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);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual void Dispose()
{
// no-op
_currentContext?.Dispose();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ private static IEnumerable<TResult> _GroupJoin<TOuter, TInner, TKey, TResult>(
GroupJoinInclude outerGroupJoinInclude,
GroupJoinInclude innerGroupJoinInclude)
{
var outerGroupJoinIncludeContext = outerGroupJoinInclude?.Initialize(queryContext);
var innerGroupJoinIncludeContext = innerGroupJoinInclude?.Initialize(queryContext);
var outerGroupJoinIncludeContext = outerGroupJoinInclude?.CreateIncludeContext(queryContext);
var innerGroupJoinIncludeContext = innerGroupJoinInclude?.CreateIncludeContext(queryContext);

try
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c624d11

Please sign in to comment.