Otter SDK Reference
Version:

GetFactory(System.Type type, bool allowNonPublicConstructor) Method

Returns a factory method that can be used to create an instance of the specified type.

Syntax

public static Func<object> GetFactory(System.Type type, bool allowNonPublicConstructor)

Parameters

type
Type: System.Type

The type to return a factory method for.

allowNonPublicConstructor
Type: bool

Value indicating whether nonpublic constructors should be considered.

Returns

Factory method that can be used to create an instance of the specified type.

Exceptions

System.ArgumentNullException

type is null (Nothing in Visual Basic).

System.ArgumentException

type does not have a public parameterless constructor.