views:

57

answers:

1

i have class, with fields of double? type. with reflection i get fields

Parameters cl = new Parameters();
FieldInfo[] fi = cl.GetType().GetFields((BindingFlags.NonPublic | BindingFlags.Instance));

now, i want get fields, only with double? type, gow can i get this type, to compare with fields from fi?

smth like:

if(fi[0].FieldType == (double?).GetType()){...}
+1  A: 
if(fi[0].FieldType == typeof(Nullable<double>)){...}

or

if(fi[0].FieldType == typeof(double?)){...}
Andrey
ok guys, now i know about it, i'll make it
eba
...or just `typeof(double?)` to keep the used type identifiers consistent (even though it is equivalent).
Lucero