mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-10 23:57:59 +08:00
Add : QueryableByObject.ToTree
This commit is contained in:
parent
385b844c38
commit
aaf47e7824
@ -283,6 +283,14 @@ namespace SqlSugar
|
|||||||
var reslt = method.Invoke(QueryableObj, new object[] { });
|
var reslt = method.Invoke(QueryableObj, new object[] { });
|
||||||
return Convert.ToBoolean(reslt);
|
return Convert.ToBoolean(reslt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public object ToTree(string childPropertyName, string parentIdPropertyName, object rootValue, string primaryKeyPropertyName)
|
||||||
|
{
|
||||||
|
var method = QueryableObj.GetType().GetMyMethod("ToTree", 4,typeof(string),typeof(string),typeof(object),typeof(string));
|
||||||
|
var reslt = method.Invoke(QueryableObj, new object[] {childPropertyName,parentIdPropertyName,rootValue,primaryKeyPropertyName });
|
||||||
|
return reslt;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Result Async
|
#region Result Async
|
||||||
@ -323,6 +331,13 @@ namespace SqlSugar
|
|||||||
var task = (Task)method.Invoke(QueryableObj, new object[] { pkValue });
|
var task = (Task)method.Invoke(QueryableObj, new object[] { pkValue });
|
||||||
return await GetTask(task).ConfigureAwait(false);
|
return await GetTask(task).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<object> ToTreeAsync(string childPropertyName, string parentIdPropertyName, object rootValue, string primaryKeyPropertyName)
|
||||||
|
{
|
||||||
|
var method = QueryableObj.GetType().GetMyMethod("ToTreeAsync", 4, typeof(string), typeof(string), typeof(object), typeof(string));
|
||||||
|
var task =(Task)method.Invoke(QueryableObj, new object[] { childPropertyName, parentIdPropertyName, rootValue, primaryKeyPropertyName });
|
||||||
|
return await GetTask(task).ConfigureAwait(false);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Helper
|
#region Helper
|
||||||
|
Loading…
Reference in New Issue
Block a user