public static HasDefaultConstructor ( this type ) : bool | ||
type | this | |
return | bool |
public static bool HasDefaultConstructor(this Type type) {
type.ShouldNotBeNull("type");
if(type.IsValueType)
return true;
return (type.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, new Type[0], null) != null);
}