c# - handle this datatype whith reflection -
i don't know how handle datatype.
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 ienumerable) { //this works lists, not datatype have here(see link in post) //i "null" "y.getvalue(item)" element.add(item.gettype().getproperties().todictionary(y => y.name, y => y.getvalue(item))); } }
immediate window:
wert ienumerable
will return:
count = 1 [0]: "51000"
here can find deeper informations: click
for y
in foreach
fail when hits y.getvalue(item)
: click
how can solve problem ?
Comments
Post a Comment