Skip to content

Commit 8357af7

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/netcore'
2 parents 66460a1 + 088d06c commit 8357af7

6 files changed

+157
-163
lines changed

doc/Developing-Step-By-Step-Angular.html

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ <h3>Creating Person Entity</h3>
218218
MaxLength</strong> properties. This is a good practice since we will use same
219219
values later.</p>
220220
<p>We add a DbSet property for Person entity to <strong>PhoneBookDbContext</strong>
221-
class defined in <strong>.EntityFramework</strong> project.</p>
221+
class defined in <strong>.EntityFrameworkCore</strong> project.</p>
222222

223223
<pre lang="cs">public class PhoneBookDbContext : AbpZeroDbContext&lt;Tenant, Role, User&gt;
224224
{
@@ -245,24 +245,24 @@ <h3>Database Migrations</h3>
245245
{
246246
migrationBuilder.CreateTable(
247247
name: "PbPersons",
248-
columns: table => new
248+
columns: table =&gt; new
249249
{
250-
Id = table.Column<int>(nullable: false)
250+
Id = table.Column(nullable: false)
251251
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
252-
CreationTime = table.Column<DateTime>(nullable: false),
253-
CreatorUserId = table.Column<long>(nullable: true),
254-
DeleterUserId = table.Column<long>(nullable: true),
255-
DeletionTime = table.Column<DateTime>(nullable: true),
256-
EmailAddress = table.Column<string>(maxLength: 255, nullable: true),
257-
IsDeleted = table.Column<bool>(nullable: false),
258-
LastModificationTime = table.Column<DateTime>(nullable: true),
259-
LastModifierUserId = table.Column<long>(nullable: true),
260-
Name = table.Column<string>(maxLength: 32, nullable: false),
261-
Surname = table.Column<string>(maxLength: 32, nullable: false)
252+
CreationTime = table.Column(nullable: false),
253+
CreatorUserId = table.Column(nullable: true),
254+
DeleterUserId = table.Column(nullable: true),
255+
DeletionTime = table.Column(nullable: true),
256+
EmailAddress = table.Column(maxLength: 255, nullable: true),
257+
IsDeleted = table.Column(nullable: false),
258+
LastModificationTime = table.Column(nullable: true),
259+
LastModifierUserId = table.Column(nullable: true),
260+
Name = table.Column(maxLength: 32, nullable: false),
261+
Surname = table.Column(maxLength: 32, nullable: false)
262262
},
263-
constraints: table =>
263+
constraints: table =&gt;
264264
{
265-
table.PrimaryKey("PK_PbPersons", x => x.Id);
265+
table.PrimaryKey("PK_PbPersons", x =&gt; x.Id);
266266
});
267267
}
268268

@@ -271,8 +271,7 @@ <h3>Database Migrations</h3>
271271
migrationBuilder.DropTable(
272272
name: "PbPersons");
273273
}
274-
}
275-
</pre>
274+
}</pre>
276275
<p>We don't have to know so much about format and rules of this file. But, it's
277276
suggested to have a basic understanding of migrations. In the same Package Manager Console, we write <strong>Update-Database</strong> command in order to
278277
apply the new migration to database. After updating, we can see that <strong>PbPersons
@@ -285,11 +284,7 @@ <h3>Database Migrations</h3>
285284
<img class="img-thumbnail" alt="Seed folders" src="images/aspnet-core-ef-seed-1.png" /></p>
286285
<p>So, we can add a seperated class to fill some people to database
287286
as shown below:</p>
288-
<pre lang="cs">using System.Linq;
289-
using Acme.PhoneBook.EntityFramework;
290-
using Acme.PhoneBook.People;
291-
292-
namespace Acme.PhoneBook.Migrations.Seed.Host
287+
<pre lang="cs">namespace Acme.PhoneBook.Migrations.Seed.Host
293288
{
294289
public class InitialPeopleCreator
295290
{

0 commit comments

Comments
 (0)