Update inseret nav

This commit is contained in:
sunkaixuan 2022-07-04 05:00:39 +08:00
parent 96ac3b63af
commit ee11466d12

View File

@ -13,7 +13,7 @@ namespace SqlSugar
public SqlSugarProvider Context { get; set; }
public InsertNavProvider<Root, Root> insertNavProvider { get; set; }
public InsertNavTask<Root, TChild> ThenInclude<TChild>(Expression<Func<Root, TChild>> expression) where TChild : class, new()
public InsertNavTask<Root, TChild> Include<TChild>(Expression<Func<Root, TChild>> expression) where TChild : class, new()
{
this.Context = insertNavProvider._Context;
InsertNavTask<Root, TChild> result = new InsertNavTask<Root, TChild>();
@ -22,7 +22,7 @@ namespace SqlSugar
result.Context = this.Context;
return result;
}
public InsertNavTask<Root, TChild> ThenInclude<TChild>(Expression<Func<Root, List<TChild>>> expression) where TChild : class, new()
public InsertNavTask<Root, TChild> Include<TChild>(Expression<Func<Root, List<TChild>>> expression) where TChild : class, new()
{
this.Context = insertNavProvider._Context;
InsertNavTask<Root, TChild> result = new InsertNavTask<Root, TChild>();
@ -52,6 +52,14 @@ namespace SqlSugar
result.Context = this.Context;
return result;
}
public InsertNavTask<Root, TChild> Include<TChild>(Expression<Func<Root, TChild>> expression) where TChild : class, new()
{
return AsNav().ThenInclude(expression);
}
public InsertNavTask<Root, TChild> Include<TChild>(Expression<Func<Root, List<TChild>>> expression) where TChild : class, new()
{
return AsNav().ThenInclude(expression);
}
public void ExecuteCommand()
{
var hasTran = this.Context.Ado.Transaction != null;
@ -76,7 +84,7 @@ namespace SqlSugar
});
}
public InsertNavTask<Root, Root> AsNav()
private InsertNavTask<Root, Root> AsNav()
{
InsertNavTask<Root, Root> result = new InsertNavTask<Root, Root>();
Func<InsertNavProvider<Root, Root>> func = () => PreFunc().AsNav();