修复 .ToList(a => a.id) 当 id 是 guid 类型时,会出现类型转换失败 bug;

This commit is contained in:
28810
2019-04-11 12:30:54 +08:00
parent 8da9474013
commit b5c79204d8
8 changed files with 52 additions and 7 deletions

View File

@ -1098,6 +1098,7 @@ namespace FreeSql.Internal {
}
public static object GetDataReaderValue(Type type, object value) {
if (value == null || value == DBNull.Value) return null;
if (type == null) return value;
var func = _dicGetDataReaderValue.GetOrAdd(type, k1 => new ConcurrentDictionary<Type, Func<object, object>>()).GetOrAdd(value.GetType(), valueType => {
var parmExp = Expression.Parameter(typeof(object), "value");
var exp = GetDataReaderValueBlockExpression(type, parmExp);