mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 04:53:45 +08:00
Update Core
This commit is contained in:
@@ -278,14 +278,13 @@ namespace SqlSugar
|
||||
var typeName = tType.Name;
|
||||
if (item.PropertyType.IsClass())
|
||||
{
|
||||
if (readerValues != null &&
|
||||
readerValues.Count == 1 &&
|
||||
readerValues.First().Key == name &&
|
||||
readerValues.First().Value!=null&&
|
||||
readerValues.First().Value.GetType()==UtilConstants.StringType&&
|
||||
Regex.IsMatch(readerValues.First().Value.ObjToString(), @"^\{.+\}$"))
|
||||
if (IsJsonItem(readerValues, name))
|
||||
{
|
||||
result.Add(name, DeserializeObject<Dictionary<string,object>>(readerValues.First().Value.ObjToString()));
|
||||
result.Add(name, DeserializeObject<Dictionary<string, object>>(readerValues.First().Value.ObjToString()));
|
||||
}
|
||||
else if (IsJsonList(readerValues, item))
|
||||
{
|
||||
result.Add(name, DeserializeObject<List<Dictionary<string, object>>>(readerValues[item.Name.ToLower()].ToString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -336,6 +335,25 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool IsJsonItem(Dictionary<string, object> readerValues, string name)
|
||||
{
|
||||
return readerValues != null &&
|
||||
readerValues.Count == 1 &&
|
||||
readerValues.First().Key == name &&
|
||||
readerValues.First().Value != null &&
|
||||
readerValues.First().Value.GetType() == UtilConstants.StringType &&
|
||||
Regex.IsMatch(readerValues.First().Value.ObjToString(), @"^\{.+\}$");
|
||||
}
|
||||
|
||||
private static bool IsJsonList(Dictionary<string, object> readerValues, PropertyInfo item)
|
||||
{
|
||||
return item.PropertyType.FullName.IsCollectionsList() &&
|
||||
readerValues.ContainsKey(item.Name.ToLower()) &&
|
||||
readerValues[item.Name.ToLower()] != null &&
|
||||
readerValues[item.Name.ToLower()].GetType() == UtilConstants.StringType &&
|
||||
Regex.IsMatch(readerValues[item.Name.ToLower()].ToString(), @"^\[{.+\}]$");
|
||||
}
|
||||
|
||||
private Dictionary<string, object> DataReaderToDynamicList_Part<T>(Dictionary<string, object> readerValues, PropertyInfo item, List<T> reval)
|
||||
{
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
|
Reference in New Issue
Block a user