C# reflection getting nullable type
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()){...}
if(fi[0].FieldType == typeof(Nullable<double>)){...}
or
if(fi[0].FieldType == typeof(double?)){...}
精彩评论