maliming
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
docs/zh-Hans/Entity-Framework-Core-Migrations.md
-
docs/zh-Hans/Entity-Framework-Core.md
|
|
|
@ -400,7 +400,7 @@ builder.Entity<AppRole>(b => |
|
|
|
* `ConfigureByConvention()` 配置了标准/基本属性(像`TenantId`),建议总是调用它. |
|
|
|
|
|
|
|
你已经为你的 `DbContext` 配置自定义属性,该属性在应用程序运行时使用. |
|
|
|
与其直接更改 `MigrationsDbContext`,我们应该使用ABP框架的实体扩展系统,找到 在解决方案的 `.EntityFrameworkCore` 项目中找到 `YourProjectNameEntityExtensions` 类(本示例中是 `BookStoreEntityExtensions`)并且进行以下更改: |
|
|
|
与其直接更改 `MigrationsDbContext`,我们应该使用ABP框架的实体扩展系统,在解决方案的 `.EntityFrameworkCore` 项目中找到 `YourProjectNameEntityExtensions` 类(本示例中是 `BookStoreEntityExtensions`)并且进行以下更改: |
|
|
|
|
|
|
|
````csharp |
|
|
|
public static class MyProjectNameEntityExtensions |
|
|
|
|
|
|
|
@ -315,7 +315,7 @@ public class BookService |
|
|
|
|
|
|
|
`EntityExtensionManager` 的 `AddProperty` 方法允许你实体定义附加的属性. |
|
|
|
|
|
|
|
**示例**: 浅咖 `Title` 属性 (数据库字段)到 `IdentityRole` 实体: |
|
|
|
**示例**: 添加 `Title` 属性 (数据库字段)到 `IdentityRole` 实体: |
|
|
|
|
|
|
|
````csharp |
|
|
|
EntityExtensionManager.AddProperty<IdentityRole, string>( |
|
|
|
|