Class NullObjectFactory<TObject>
Implementation of INullObject and IFactory<TCreate>. Used to create an instance of a INullObject where IsNull is set to true by default.
Implements
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Common.dll
Syntax
public class NullObjectFactory<TObject> : Factory<TObject>, IFactory<TObject> where TObject : INullObject
Type Parameters
| Name | Description |
|---|---|
| TObject |
Constructors
| Improve this Doc View SourceNullObjectFactory(IFactory<TObject>)
Initializes the NullObjectFactory<TObject> using a IFactory<TCreate> and its FactoryMode to set the FactoryMode.
Declaration
public NullObjectFactory(IFactory<TObject> factory)
Parameters
| Type | Name | Description |
|---|---|---|
| IFactory<TObject> | factory | The IFactory<TCreate> to create instances of type |
NullObjectFactory(Func<TObject>)
Initializes the NullObjectFactory<TObject> using a factory method delegate using Singleton.
Declaration
public NullObjectFactory(Func<TObject> factoryMethod)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TObject> | factoryMethod | The delegate to create instances of type |
NullObjectFactory(Func<TObject>, FactoryMode)
Initializes the NullObjectFactory<TObject> using a factory method delegate using Singleton.
Declaration
public NullObjectFactory(Func<TObject> factoryMethod, FactoryMode factoryMode)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TObject> | factoryMethod | The delegate to create instances of type |
| FactoryMode | factoryMode | The lifetime scope of the created instance. |
Methods
| Improve this Doc View SourceCreateInstance()
Implementation to create and initialize instances of type TObject.
Declaration
protected override TObject CreateInstance()
Returns
| Type | Description |
|---|---|
| TObject | An instance of type |
Overrides
CreateInstance(Object[])
Implementation to create and initialize instances of type TObject.
Declaration
protected override TObject CreateInstance(params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| Object[] | args | A variable list of arguments. |
Returns
| Type | Description |
|---|---|
| TObject | An instance of type |