c# - GetIndexParameters() empty on Dictionary property -
i'm using reflection info class i'm exporting excel. loops through properties values.
i want able handle indexed types list
s , dictionary
s. however, getindexparameters()
method on property returning none. using wrong?
here can see prop.property
(which propertyinfo
) showing value dictionary<int, decimal>
, indexparams
has 0 length.
loop logic (slightly modified so, partially pseudocode)
foreach (var prop in exportingpropertiesinorder) { //detect if needs have indexing applied. var indexparams = prop.property.getindexparameters(); var isindexed = indexparams.any(); if (!isindexed) { //get value property export }else{ //loop through indeces, each value }
the property shown on screenshot dictionary<int, decimal> tiervalues
it not indexer, getindexparameters()
method on property returning empty array
dictionary<int, decimal>
type has indexed property item
Comments
Post a Comment