mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-12 19:30:59 +08:00
update
13
实体关系.md
13
实体关系.md
@@ -19,6 +19,19 @@ public virtual List<tag> tags { get; set; }
|
|||||||
- 无关联的,查询时可以指明 On 条件,LeftJoin(a => a.Parent.Id == a.ParentId);
|
- 无关联的,查询时可以指明 On 条件,LeftJoin(a => a.Parent.Id == a.ParentId);
|
||||||
- 已关联的,直接使用导航对象就行,On 条件会自动附上;
|
- 已关联的,直接使用导航对象就行,On 条件会自动附上;
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
也可以使用 FluentApi 在外部设置导航关系:
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
fsql.CodeFirst.ConfigEntity<实体类>(a => a
|
||||||
|
.Navigate(b => b.roles, null, typeof(多对多中间实体类))
|
||||||
|
.Navigate(b => b.users, "uid")
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
优先级,特性 > FluentApi
|
||||||
|
|
||||||
# 约定配置
|
# 约定配置
|
||||||
|
|
||||||
### OneToOne 一对一
|
### OneToOne 一对一
|
||||||
|
|||||||
Reference in New Issue
Block a user