Table of Contents

CreateInstance Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Patterns.cs

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

factory Action<T>

The delegate that will initialize the public write properties of T.

Returns

T

A default constructed instance of T initialized with factory.

Type Parameters

T

The type of the class having a default constructor.