mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Synchronization code
This commit is contained in:
parent
c045b95ae7
commit
9578610223
@ -20,6 +20,25 @@ namespace SqlSugar
|
||||
_Includes<T, TReturn1>(this.Context, include1);
|
||||
return this;
|
||||
}
|
||||
public ISugarQueryable<T> IncludesByNameString(string navMemberName)
|
||||
{
|
||||
var navs = this.EntityInfo.Columns.Where(it => it.Navigat != null&&it.PropertyName.EqualCase(navMemberName)).ToList();
|
||||
foreach (var item in navs)
|
||||
{
|
||||
var properyType = item.PropertyInfo.PropertyType;
|
||||
var properyItemType = properyType;
|
||||
if (properyType.FullName.IsCollectionsList())
|
||||
{
|
||||
properyItemType = properyType.GetGenericArguments()[0];
|
||||
}
|
||||
var exp = ExpressionBuilderHelper.CreateExpressionSelectField(typeof(T), item.PropertyName, properyType);
|
||||
var method = this.GetType().GetMethods().Where(it => it.Name == "IncludesByExpression")
|
||||
.First()
|
||||
.MakeGenericMethod(properyItemType);
|
||||
method.Invoke(this, new object[] { exp });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public ISugarQueryable<T> IncludesAllFirstLayer(params string[] ignoreProperyNameList)
|
||||
{
|
||||
var navs=this.EntityInfo.Columns.Where(it => it.Navigat != null).ToList();
|
||||
|
@ -16,6 +16,7 @@ namespace SqlSugar
|
||||
NavISugarQueryable<T> AsNavQueryable();
|
||||
ISugarQueryable<T> IncludesByExpression2<TReturn1, TReturn2>(Expression include1, Expression include2);
|
||||
ISugarQueryable<T> IncludesByExpression<TReturn1>(Expression include1);
|
||||
ISugarQueryable<T> IncludesByNameString(string navMemberName);
|
||||
ISugarQueryable<T> IncludesAllFirstLayer(params string[] ignoreProperyNameList);
|
||||
ISugarQueryable<T> IncludesAllSecondLayer<TReturn1>(Expression<Func<T, TReturn1>> expression,params string[] ignoreProperyNameList);
|
||||
ISugarQueryable<T> Includes<TReturn1>(Expression<Func<T, List<TReturn1>>> include1);
|
||||
|
Loading…
Reference in New Issue
Block a user