Browse Source

Use ConfigureByConvention

pull/1595/head
Halil İbrahim Kalkan 7 years ago
parent
commit
749d6828b9
  1. 2
      docs/en/Tutorials/AspNetCore-Mvc/Part-I.md
  2. 6
      samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContextModelCreatingExtensions.cs

2
docs/en/Tutorials/AspNetCore-Mvc/Part-I.md

@ -98,7 +98,7 @@ Open `BookStoreDbContextModelCreatingExtensions.cs` file in the `Acme.BookStore.
builder.Entity<Book>(b =>
{
b.ToTable(BookStoreConsts.DbTablePrefix + "Books", BookStoreConsts.DbSchema);
b.ConfigureAuditedAggregateRoot(); //auto configure for the base class props
b.ConfigureByConvention(); //auto configure for the base class props
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
});
````

6
samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContextModelCreatingExtensions.cs

@ -17,11 +17,7 @@ namespace Acme.BookStore.EntityFrameworkCore
builder.Entity<Book>(b =>
{
b.ToTable(BookStoreConsts.DbTablePrefix + "Books", BookStoreConsts.DbSchema);
b.ConfigureAudited();
b.ConfigureExtraProperties();
b.ConfigureConcurrencyStamp();
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
});
}

Loading…
Cancel
Save