Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# create default instance of type

public object GetDefaultValue(Type type)
{
    return type.IsValueType ? Activator.CreateInstance(type) : null;
} 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #default #instance #type
ADD COMMENT
Topic
Name
7+9 =