I am trying to get default value of a property from it's Type.
But I get an error (comment in my code).
Spent quiet some time on this, any help would be appreciated, Thanks.
This is a simplified version of the code.
public void test<T>(T classObject)
{
Type t = typeof(T);
var properties = t.GetProperties(BindingFlags.Public);
foreach (var prop in properties)
{
var type = prop.GetType();
var defaultValue = default(type); //Get an error here saying "the type or namespace name "type" could not be found
}
}