提交 cfce48ee 编写于 作者: D DarkWanderer

Added array underlying type conversion

上级 b2b716da
......@@ -1246,6 +1246,14 @@ private static T GetValue<T>(IDataReader reader, Type effectiveType, object val)
{
return default;
}
else if (val is Array array && typeof(T).IsArray)
{
var elementType = typeof(T).GetElementType();
var result = Array.CreateInstance(elementType, array.Length);
for (int i = 0; i < array.Length; i++)
result.SetValue(Convert.ChangeType(array.GetValue(i), elementType, CultureInfo.InvariantCulture), i);
return (T)(object)result;
}
else
{
try
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册