mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-05 07:50:52 +08:00
Created Import Entity Configuration from Database (markdown)
31
Import-Entity-Configuration-from-Database.md
Normal file
31
Import-Entity-Configuration-from-Database.md
Normal file
@@ -0,0 +1,31 @@
|
||||
[中文](%e5%af%bc%e5%85%a5%e6%95%b0%e6%8d%ae%e5%ba%93%e7%89%b9%e6%80%a7) | **English**
|
||||
|
||||
可以解决,数据库有主键 + 自增,实体层没有配置对应的特性;
|
||||
|
||||
从数据库导入主键、自增信息,适用 DbFirst 模式,无须在实体类型上设置 [Column(IsPrimary)] 或者 ConfigEntity;
|
||||
|
||||
```csharp
|
||||
fsql.CodeFirst.IsConfigEntityFromDbFirst = true;
|
||||
```
|
||||
|
||||
此功能目前可用于 mysql/sqlserver/postgresql/oracle。
|
||||
|
||||
> 开启该功能会增加首次执行时间(耗时情况和表数量有关)
|
||||
|
||||
## 优先级
|
||||
|
||||
数据库特性 > 实体特性 > FluentApi(配置特性) > Aop(配置特性)
|
||||
|
||||
## 参考资料
|
||||
|
||||
- [《实体特性说明》](%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)
|
||||
Reference in New Issue
Block a user