-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e1c178
commit 7a75039
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using SqlSugar; | ||
namespace OrmTest | ||
{ | ||
public class UnitNavDynamic | ||
{ | ||
public static void Init() | ||
{ | ||
var db = NewUnitTest.Db; | ||
var list=db.Queryable<UnitAddress011>().Includes(x => x.Persons).ToList(); | ||
} | ||
[SqlSugar.SugarTable("UnitPerson0x1x1")] | ||
public class UnitPerson011 | ||
{ | ||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public int AddressId { get; set; } | ||
public int AddressId2 { get; set; } | ||
} | ||
[SqlSugar.SugarTable("UnitAddress0x1x1")] | ||
public class UnitAddress011 | ||
{ | ||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] | ||
public int Id { get; set; } | ||
public string Street { get; set; } | ||
[SqlSugar.Navigate(SqlSugar.NavigateType.Dynamic, "[{m:\"Id\",c:\"AddressId\"},{m:\"Id\",c:\"AddressId\"}]")] | ||
public List<UnitPerson011> Persons { get; set; } | ||
//[SqlSugar.Navigate(SqlSugar.NavigateType.OneToMany, nameof(UnitPerson011.AddressId2))] | ||
//public List<UnitPerson011> Persons2 { get; set; } | ||
} | ||
} | ||
} |