A
Andrus
My type contains constructor with nullable parameter like
public class Iandmed {
public Iandmed(DateTime? miskuup) {}
}
I tried to get its constructor parameter type name using
Type t = typeof(Iandmed);
ConstructorInfo c = t.GetConstructors()[0];
ParameterInfo p = c.GetParameters()[0];
p.ParameterType.Name returns wrong values for nullable types, in this case
"Nullable`1"
How to get exact type name:
"DateTime?"
Andrus.
public class Iandmed {
public Iandmed(DateTime? miskuup) {}
}
I tried to get its constructor parameter type name using
Type t = typeof(Iandmed);
ConstructorInfo c = t.GetConstructors()[0];
ParameterInfo p = c.GetParameters()[0];
p.ParameterType.Name returns wrong values for nullable types, in this case
"Nullable`1"
How to get exact type name:
"DateTime?"
Andrus.