我不知道如何处理这种数据类型。
object wert = x.GetValue(instanz);
List<object> element = new List<object>();
if (wert.GetType().GetInterfaces().Any(t => t == typeof(IEnumerable)))
{
foreach (var item in wert as IEnumerable)
{
//this works for Lists, but not for the Datatype i have here(see link in my post)
//I get "null" for "y.GetValue(item)"
element.Add(item.GetType().GetProperties().ToDictionary(y => y.Name, y => y.GetValue(item)));
}
}
立即窗口:
wert as IEnumerable
将返回:
Count = 1
[0]: "51000"
您可以在此处找到更深入的信息:click
对于y
foreach
y.GetValue(item)
点击import datetime,pytz
var1 = datetime.datetime(2017,10,25,20,10,50,tzinfo=pytz.timezone("Europe/Athens")))
print(var1)
时会失败:click
我该如何解决这个问题?