Class CsModelStore
Model storage class used to store c# code factory models, to be used to pass data to factories.
Inherited Members
Namespace: CodeFactory.DotNet.CSharp
Assembly: CodeFactory.DotNet.dll
Syntax
public class CsModelStore
Constructors
| Improve this Doc View SourceCsModelStore()
Creates a new instance of the CsModelStore and initializes the store for data to be added.
Declaration
public CsModelStore()
CsModelStore(ICsModel)
Creates a new instance of the CsModelStore and sets a single model in the store.
Declaration
public CsModelStore(ICsModel model)
Parameters
Type | Name | Description |
---|---|---|
ICsModel | model | The model to be added to the store. |
CsModelStore(Dictionary<string, IEnumerable<ICsModel>>)
Creates a new instance of the CsModelStore and loads all the data for all the categories.
Declaration
public CsModelStore(Dictionary<string, IEnumerable<ICsModel>> allModels)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, IEnumerable<ICsModel>> | allModels | All the model data to be added to the store. |
Properties
| Improve this Doc View SourceModel
The single ICsModel that is provided for the T4 Template.
Declaration
public ICsModel Model { get; }
Property Value
Type | Description |
---|---|
ICsModel |
Methods
| Improve this Doc View SourceAddModels(string, IEnumerable<ICsModel>)
Adds many C# models to the store by category.
Declaration
public void AddModels(string category, IEnumerable<ICsModel> models)
Parameters
Type | Name | Description |
---|---|---|
string | category | Name used to keep track of the models that are stored together. |
IEnumerable<ICsModel> | models | The models stored by the target category. |
Models(string)
Gets the models from a target category.
Declaration
public IEnumerable<ICsModel> Models(string category)
Parameters
Type | Name | Description |
---|---|---|
string | category | Category to get models for. |
Returns
Type | Description |
---|---|
IEnumerable<ICsModel> | Returns a enumeration of the models. If no models were found then an empty enumeration is returned. |
SetModel(ICsModel)
Sets the single model to be shared with a factory.
Declaration
public void SetModel(ICsModel model)
Parameters
Type | Name | Description |
---|---|---|
ICsModel | model | Target model to be used in a factory. |