AggregateRootRepository

This commit is contained in:
2881099
2022-09-03 17:59:57 +08:00
parent 319467dcc4
commit a590b8aa7b
6 changed files with 577 additions and 494 deletions

View File

@ -15,7 +15,6 @@ namespace FreeSql.Tests.DbContext2
{
public OrderRepository(IFreeSql fsql, UnitOfWorkManager uowManager) : base(uowManager?.Orm ?? fsql)
{
var code = SelectAggregateRootStaticCode;
}
public override ISelect<Order> Select => base.SelectDiy;
@ -28,6 +27,14 @@ namespace FreeSql.Tests.DbContext2
{
new OrderRepository(fsql, null);
var code = AggregateRootUtils.GetAutoIncludeQueryStaicCode(fsql, typeof(Order));
Assert.Equal(@"//fsql.Select<Order>()
SelectDiy
.IncludeMany(a => a.Details, then => then
.Include(b => b.Extdata))
.IncludeMany(a => a.Tags)
.Include(a => a.Extdata)", code);
fsql.Insert(new[]
{
new Tag { Name = "tag1" },