Method ConstructTypeDerivedFrom
ConstructTypeDerivedFrom<T>()
Construct instance of first type derived from T
.
Derived type must have an implicit, default or registered constructor.
Declaration
public static T ConstructTypeDerivedFrom<T>()
Returns
Type | Description |
---|---|
T | New instance of derived type. |
Type Parameters
Name | Description |
---|---|
T | The derived type. |
ConstructTypeDerivedFrom<T>(Func<Type, bool>)
Construct instance of first type derived from T
that satisfies the filtering function.
Derived type must have an implicit, default or registered constructor.
Declaration
public static T ConstructTypeDerivedFrom<T>(Func<Type, bool> filter)
Parameters
Returns
Type | Description |
---|---|
T | New instance of derived type. |
Type Parameters
Name | Description |
---|---|
T | The derived type. |
ConstructTypeDerivedFrom<T>(Func<T, bool>)
Construct instance of first type derived from T
that satisfies the condition function.
Derived type must have an implicit, default or registered constructor.
Declaration
public static T ConstructTypeDerivedFrom<T>(Func<T, bool> condition)
Parameters
Returns
Type | Description |
---|---|
T | New instance of derived type. |
Type Parameters
Name | Description |
---|---|
T | The derived type. |
ConstructTypeDerivedFrom<T>(Func<Type, bool>, Func<T, bool>)
Construct instance of first type derived from T
that satisfies both the filtering and condition functions.
Derived type must have an implicit, default or registered constructor.
Declaration
public static T ConstructTypeDerivedFrom<T>(Func<Type, bool> filter, Func<T, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
Func<Type, bool> | filter | The filtering function. |
Func<T, bool> | condition | The condition function. |
Returns
Type | Description |
---|---|
T | New instance of derived type. |
Type Parameters
Name | Description |
---|---|
T | The derived type. |