mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Add : db.Utilities.ConditionalModelsToSql
This commit is contained in:
parent
6f0dbe563d
commit
f61f2273ff
@ -1119,6 +1119,12 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Conditional
|
||||
public KeyValuePair<string, SugarParameter[]> ConditionalModelsToSql(List<IConditionalModel> conditionalModels,int beginIndex=0)
|
||||
{
|
||||
var sqlBuilder=InstanceFactory.GetSqlBuilderWithContext(this.Context);
|
||||
var result=sqlBuilder.ConditionalModelToSql(conditionalModels,beginIndex);
|
||||
return result;
|
||||
}
|
||||
public List<IConditionalModel> JsonToConditionalModels(string json)
|
||||
{
|
||||
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
||||
@ -1212,5 +1218,6 @@ namespace SqlSugar
|
||||
return (this.Context.Queryable<T>() as QueryableProvider<T>).GetTreeRoot(childListExpression, parentIdExpression, pk, list, rootValue);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +223,11 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static ISqlBuilder GetSqlBuilderWithContext(ISqlSugarClient db)
|
||||
{
|
||||
var result= GetQueryBuilderWithContext(db).Builder;
|
||||
return result;
|
||||
}
|
||||
public static ISqlBuilder GetSqlbuilder(ConnectionConfig currentConnectionConfig)
|
||||
{
|
||||
if (currentConnectionConfig.DbType == DbType.SqlServer)
|
||||
|
@ -50,5 +50,6 @@ namespace SqlSugar
|
||||
List<IConditionalModel> JsonToConditionalModels(string json);
|
||||
DataTable DictionaryListToDataTable(List<Dictionary<string, object>> dictionaryList);
|
||||
List<T> ToTree<T>(List<T> list, Expression<Func<T, IEnumerable<object>>> childListExpression, Expression<Func<T, object>> parentIdExpression, Expression<Func<T, object>> pkExpression, object rootValue);
|
||||
KeyValuePair<string, SugarParameter[]> ConditionalModelsToSql(List<IConditionalModel> conditionalModels, int beginIndex = 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user