CreateInstance Method
Definition
CreateInstance<T>(Action<T>)
Provides a generic way to initialize the default, parameterless constructed instance of T.
public static T CreateInstance<T>(Action<T> factory) where T : class, new()
Parameters
factoryAction<T>The delegate that will initialize the public write properties of
T.
Returns
- T
A default constructed instance of
Tinitialized withfactory.
Type Parameters
TThe type of the class having a default constructor.