Browse Source

Update ContextMethods

pull/12/MERGE
skx 4 years ago
parent
commit
e9cbad51d5
  1. 13
      Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs

13
Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs

@ -7,6 +7,7 @@ using System.Dynamic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SqlSugar
{
@ -276,9 +277,21 @@ namespace SqlSugar
var name = item.Name;
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(), @"^\{.+\}$"))
{
result.Add(name, DeserializeObject<Dictionary<string,object>>(readerValues.First().Value.ObjToString()));
}
else
{
result.Add(name, DataReaderToDynamicList_Part(readerValues, item, reval));
}
}
else
{
if (readerValues.Any(it => it.Key.Equals(name, StringComparison.CurrentCultureIgnoreCase)))

Loading…
Cancel
Save