Skip to content

Commit

Permalink
Updating based on API Review. (#21587)
Browse files Browse the repository at this point in the history
  • Loading branch information
lajones committed Jul 10, 2020
1 parent d0b5ab4 commit 0a0a455
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/EFCore.Design/Design/DbContextActivator.cs
Expand Up @@ -37,21 +37,21 @@ public static class DbContextActivator
/// <param name="contextType"> The <see cref="DbContext" /> type to instantiate. </param>
/// <param name="startupAssembly"> The application's startup assembly. </param>
/// <param name="reportHandler"> The design-time report handler. </param>
/// <param name="arguments"> Arguments passed to the application. </param>
/// <param name="args"> Arguments passed to the application. </param>
/// <returns> The newly created object. </returns>
public static DbContext CreateInstance(
[NotNull] Type contextType,
[CanBeNull] Assembly startupAssembly,
[CanBeNull] IOperationReportHandler reportHandler,
[CanBeNull] string[] arguments)
[CanBeNull] string[] args)
{
Check.NotNull(contextType, nameof(contextType));

return new DbContextOperations(
new OperationReporter(reportHandler),
contextType.Assembly,
startupAssembly ?? contextType.Assembly,
args: arguments ?? Array.Empty<string>())
args: args ?? Array.Empty<string>())
.CreateContext(contextType.FullName);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Migrations/MigrationBuilder.cs
Expand Up @@ -771,7 +771,7 @@ public MigrationBuilder([CanBeNull] string activeProvider)

var columnsBuilder = new ColumnsBuilder(createTableOperation);
var columnsObject = columns(columnsBuilder);
var columnMap = new Dictionary<MemberInfo, AddColumnOperation>();
var columnMap = new Dictionary<PropertyInfo, AddColumnOperation>();
foreach (var property in typeof(TColumns).GetTypeInfo().DeclaredProperties)
{
var addColumnOperation = ((IInfrastructure<AddColumnOperation>)property.GetMethod.Invoke(columnsObject, null)).Instance;
Expand Down
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.EntityFrameworkCore.Migrations.Operations.Builders
/// <typeparam name="TColumns"> Type of a typically anonymous type for building columns. </typeparam>
public class CreateTableBuilder<TColumns> : OperationBuilder<CreateTableOperation>
{
private readonly IReadOnlyDictionary<MemberInfo, AddColumnOperation> _columnMap;
private readonly IReadOnlyDictionary<PropertyInfo, AddColumnOperation> _columnMap;

/// <summary>
/// Constructs a new builder for the given <see cref="CreateTableOperation" /> and
Expand All @@ -28,7 +28,7 @@ public class CreateTableBuilder<TColumns> : OperationBuilder<CreateTableOperatio
/// <param name="columnMap"> The map of CLR properties to <see cref="AddColumnOperation" />s. </param>
public CreateTableBuilder(
[NotNull] CreateTableOperation operation,
[NotNull] IReadOnlyDictionary<MemberInfo, AddColumnOperation> columnMap)
[NotNull] IReadOnlyDictionary<PropertyInfo, AddColumnOperation> columnMap)
: base(operation)
{
Check.NotNull(columnMap, nameof(columnMap));
Expand Down Expand Up @@ -191,6 +191,6 @@ public new virtual CreateTableBuilder<TColumns> Annotation([NotNull] string name
=> (CreateTableBuilder<TColumns>)base.Annotation(name, value);

private string[] Map(LambdaExpression columns)
=> columns.GetMemberAccessList().Select(c => _columnMap[c].Name).ToArray();
=> columns.GetPropertyAccessList().Select(c => _columnMap[c].Name).ToArray();
}
}

0 comments on commit 0a0a455

Please sign in to comment.