Click or drag to resize

FastObjectFactoryGetCreateObjectFunctionT(Type) Method

Gets delegate of specified return type that creates new instance of the type.

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.249-beta+56964f8aed6f3f2e54faec1539f7ce0ba6548fdf
Syntax
public static Func<T> GetCreateObjectFunction<T>(
	Type type
)
View Source

Parameters

type  Type
Type of object to create quickly.

Type Parameters

T
Type of returned object function used to create objects quickly.

Return Value

FuncT
Delegate to use to quickly create new objects.
Exceptions
ExceptionCondition
InvalidOperationExceptiontype does not support parameterless public constructor -or- type is not a subclass or interface implementation of function type definition.
Remarks
This function will validate that T is related to type.
See Also