Class Factory<T1>
A factory helper class for creating instances using a constructor with a single strongly typed argument.
Inheritance
System.Object
Factory<T1>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: SpiceSharp.Reflection
Assembly: SpiceSharp.dll
Syntax
public static class Factory<T1>
Type Parameters
| Name | Description |
|---|---|
| T1 | The type of the constructor argument. |
Methods
Get(Type, T1)
Gets an instance of the specified type.
Declaration
public static object Get(Type type, T1 argument)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type of the result. |
| T1 | argument | The argument. |
Returns
| Type | Description |
|---|---|
| System.Object | An instance of the specified type. |
Get<TResult>(T1)
Gets an instance of the specified type.
Declaration
public static TResult Get<TResult>(T1 argument)
Parameters
| Type | Name | Description |
|---|---|---|
| T1 | argument | The argument. |
Returns
| Type | Description |
|---|---|
| TResult | An instance of the specified type. |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |