System.Reflection.PropertyInfo[] props = d.GetType().GetProperties();
foreach(var prop in props) {
object val = prop.GetValue(d);
System.Type type = prop.PropertyType;
bool isNullable = (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>));
(( isNullable|| type.IsValueType == false) && val != null)
|| (!isNullable && type.IsValueType) && val.ToString() != Activator.CreateInstance(type).ToString()
Console.WriteLine(isDefault+System.Environment.NewLine);
public int? i2 {get;set;}
public string s {get;set;}