Update Nav.Dynamic

This commit is contained in:
sunkaixuan
2023-09-29 16:02:47 +08:00
parent 7a750390c9
commit 4ba9ecc3fc
2 changed files with 23 additions and 0 deletions

View File

@@ -11,6 +11,21 @@ namespace OrmTest
{
var db = NewUnitTest.Db;
var list=db.Queryable<UnitAddress011>().Includes(x => x.Persons).ToList();
var list2 = db.Queryable<UnitPerson011>()
.Includes(x => x.adds)
.Includes(x => x.adds2).ToList();
if (list.First().Persons.Count() != 1)
{
throw new Exception("unit error");
}
if (list2.First().adds==null)
{
throw new Exception("unit error");
}
if (list2.Last().adds2 == null)
{
throw new Exception("unit error");
}
}
[SqlSugar.SugarTable("UnitPerson0x1x1")]
public class UnitPerson011
@@ -20,6 +35,10 @@ namespace OrmTest
public string Name { get; set; }
public int AddressId { get; set; }
public int AddressId2 { get; set; }
[SqlSugar.Navigate(SqlSugar.NavigateType.Dynamic, "[{m:\"AddressId\",c:\"Id\"},{m:\"AddressId\",c:\"Id\"}]")]
public UnitAddress011 adds { get; set; }
[SqlSugar.Navigate(SqlSugar.NavigateType.Dynamic, "[{m:\"AddressId2\",c:\"Id\"},{m:\"AddressId2\",c:\"Id\"}]")]
public UnitAddress011 adds2 { get; set; }
}
[SqlSugar.SugarTable("UnitAddress0x1x1")]
public class UnitAddress011