mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-16 13:20:57 +08:00
Updated Import Entity Configuration from Database (markdown)
@@ -1,31 +1,27 @@
|
||||
[中文](%e5%af%bc%e5%85%a5%e6%95%b0%e6%8d%ae%e5%ba%93%e7%89%b9%e6%80%a7) | **English**
|
||||
|
||||
可以解决,数据库有主键 + 自增,实体层没有配置对应的特性;
|
||||
This situation can be solved: the database is "with primary key + self-increment", but the entity is not configured with the corresponding attributes.
|
||||
|
||||
从数据库导入主键、自增信息,适用 DbFirst 模式,无须在实体类型上设置 [Column(IsPrimary)] 或者 ConfigEntity;
|
||||
Import primary key and self-increment information from the database, apply DbFirst mode, no need to set `[Column(IsPrimary)]` or ConfigEntity on the entity type:
|
||||
|
||||
```csharp
|
||||
fsql.CodeFirst.IsConfigEntityFromDbFirst = true;
|
||||
```
|
||||
|
||||
此功能目前可用于 mysql/sqlserver/postgresql/oracle。
|
||||
This function is currently available for mysql/sqlserver/postgresql/oracle.
|
||||
|
||||
> 开启该功能会增加首次执行时间(耗时情况和表数量有关)
|
||||
> Enabling this function will increase the first execution time (the time consumption is related to the number of tables)
|
||||
|
||||
## 优先级
|
||||
## Priority
|
||||
|
||||
数据库特性 > 实体特性 > FluentApi(配置特性) > Aop(配置特性)
|
||||
Database configuration> Entity Attribute> FluentApi> Aop (custom entity attribute)
|
||||
|
||||
## 参考资料
|
||||
## Reference
|
||||
|
||||
- [《实体特性说明》](%e5%ae%9e%e4%bd%93%e7%89%b9%e6%80%a7)
|
||||
|
||||
- [《FluentApi,享受纯净实体类》](FluentApi)
|
||||
|
||||
- [《Aop自定义特性,与其他 ORM 共用特性》](%e8%87%aa%e5%ae%9a%e4%b9%89%e7%89%b9%e6%80%a7)
|
||||
|
||||
- [《类型映射,一览便知》](%e7%b1%bb%e5%9e%8b%e6%98%a0%e5%b0%84)
|
||||
|
||||
- [《导航关系配置》](%e5%ae%9e%e4%bd%93%e5%85%b3%e7%b3%bb)
|
||||
|
||||
- [《CodeFirst模式开发介绍》](CodeFirst)
|
||||
- [《Introduction to Codefirst Mode》](CodeFirst-Mode)
|
||||
- [《CodeFirst Mode, Part 1: Entity Attributes》](Entity-Attributes)
|
||||
- [《CodeFirst Mode, Part 2: FluentApi》](FluentApi-Mode)
|
||||
- [《CodeFirst Mode, Part 3: Custom Attributes》](Custom-Attributes)
|
||||
- [《CodeFirst Mode, Part 4: Type Mapping》](Type-Mapping)
|
||||
- [《CodeFirst Mode, Part 5: Migration Structure》](Migration-Structure)
|
||||
- [《CodeFirst Mode, Part 6: Entity Relationship》](Entity-Relationship)
|
||||
|
||||
Reference in New Issue
Block a user