mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Queryable.ToDictionaryAsync
This commit is contained in:
parent
c338819d62
commit
b3cda7fa66
@ -398,6 +398,10 @@ namespace SqlSugar
|
||||
|
||||
public Dictionary<string, object> ToDictionary(Expression<Func<T, object>> key, Expression<Func<T, object>> value)
|
||||
{
|
||||
if (this.QueryBuilder.IsSingle() == false && (this.QueryBuilder.AsTables == null||this.QueryBuilder.AsTables.Count==0))
|
||||
{
|
||||
return this.MergeTable().ToDictionary(key,value);
|
||||
}
|
||||
this.QueryBuilder.ResultType = typeof(SugarCacheDictionary);
|
||||
var keyName = QueryBuilder.GetExpressionValue(key, ResolveExpressType.FieldSingle).GetResultString();
|
||||
var valueName = QueryBuilder.GetExpressionValue(value, ResolveExpressType.FieldSingle).GetResultString();
|
||||
|
@ -485,6 +485,10 @@ ParameterT parameter)
|
||||
|
||||
public async Task<Dictionary<string, object>> ToDictionaryAsync(Expression<Func<T, object>> key, Expression<Func<T, object>> value)
|
||||
{
|
||||
if (this.QueryBuilder.IsSingle() == false && (this.QueryBuilder.AsTables == null || this.QueryBuilder.AsTables.Count == 0))
|
||||
{
|
||||
return await this.MergeTable().ToDictionaryAsync(key, value);
|
||||
}
|
||||
this.QueryBuilder.ResultType = typeof(SugarCacheDictionary);
|
||||
var keyName = QueryBuilder.GetExpressionValue(key, ResolveExpressType.FieldSingle).GetResultString();
|
||||
var valueName = QueryBuilder.GetExpressionValue(value, ResolveExpressType.FieldSingle).GetResultString();
|
||||
|
Loading…
Reference in New Issue
Block a user