Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Review Updates #21587

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/EFCore.Design/Design/DbContextActivator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ public static DbContext CreateInstance(
/// <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
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public virtual CreateTableBuilder<TColumns> CreateTable<TColumns>(

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
Original file line number Diff line number Diff line change
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 virtual OperationBuilder<AddCheckConstraintOperation> CheckConstraint(
=> (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();
}
}