Skip to content

Commit

Permalink
Update managing.md (#2542)
Browse files Browse the repository at this point in the history
Aligned field name in code example with the description (e.g. Name to FullName).
  • Loading branch information
bide45 committed Jul 29, 2020
1 parent 3ee4ad7 commit 636e62f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions entity-framework/core/managing-schemas/migrations/managing.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ migrationBuilder.RenameColumn(
### Adding raw SQL

While renaming a column can be achieved via a built-in API, in many cases that is not possible. For example, we may want to replace existing `FirstName` and `LastColumn` properties with a single, new `FullName` property. The migration generated by EF Core will be the following:
While renaming a column can be achieved via a built-in API, in many cases that is not possible. For example, we may want to replace existing `FirstName` and `LastName` properties with a single, new `FullName` property. The migration generated by EF Core will be the following:

``` csharp
migrationBuilder.DropColumn(
Expand All @@ -103,7 +103,7 @@ migrationBuilder.DropColumn(
table: "Customer");

migrationBuilder.AddColumn<string>(
name: "Name",
name: "FullName",
table: "Customer",
nullable: true);
```
Expand All @@ -112,14 +112,14 @@ As before, this would cause unwanted data loss. To transfer the data from the ol

``` csharp
migrationBuilder.AddColumn<string>(
name: "Name",
name: "FullName",
table: "Customer",
nullable: true);

migrationBuilder.Sql(
@"
UPDATE Customer
SET Name = FirstName + ' ' + LastName;
SET FullName = FirstName + ' ' + LastName;
");

migrationBuilder.DropColumn(
Expand Down

0 comments on commit 636e62f

Please sign in to comment.