mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update select new json
This commit is contained in:
parent
d2cad873bd
commit
d896c78424
@ -671,7 +671,7 @@ namespace SqlSugar
|
||||
}
|
||||
else
|
||||
{
|
||||
Json(readerValues, result, name, typeName);
|
||||
Json(readerValues, result, name, typeName,item);
|
||||
}
|
||||
}
|
||||
else if (columns.Any(it => it.IsJson))
|
||||
@ -777,6 +777,24 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Json(Dictionary<string, object> readerValues, Dictionary<string, object> result, string name, string typeName, PropertyInfo item)
|
||||
{
|
||||
var key = (typeName + "." + name).ToLower();
|
||||
if (readerValues.Any(it => it.Key.EqualCase(key)))
|
||||
{
|
||||
var jsonString = readerValues.First(it => it.Key.EqualCase(key)).Value;
|
||||
AddJson(result, name, jsonString);
|
||||
}
|
||||
else
|
||||
{
|
||||
key = (item.Name + "." + name).ToLower();
|
||||
if (readerValues.Any(it => it.Key.EqualCase(key)))
|
||||
{
|
||||
var jsonString = readerValues.First(it => it.Key.EqualCase(key)).Value;
|
||||
AddJson(result, name, jsonString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddJson(Dictionary<string, object> result, string name, object jsonString)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user