Method SafeCreateInstance
SafeCreateInstance(Type)
Safely creates an instance of the specified type if it has a parameterless constructor.
public static object? SafeCreateInstance(Type type)
Parameters
Returns
- object
An instance of the specified type if it has a parameterless constructor; otherwise,
null
.