Class EPiServerDynamicDataStoreFactory
Concrete implementation of the DynamicDataStoreFactory class
Implements
Inherited Members
Namespace: EPiServer.Data.Dynamic
Assembly: EPiServer.Data.dll
Version: 9.12.2Syntax
public class EPiServerDynamicDataStoreFactory : DynamicDataStoreFactory, IDisposable
Constructors
EPiServerDynamicDataStoreFactory()
Initializes the class with default settings
Declaration
public EPiServerDynamicDataStoreFactory()
EPiServerDynamicDataStoreFactory(Boolean)
Initializes the class with the specified settings
Declaration
public EPiServerDynamicDataStoreFactory(bool autoRemapStores)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | autoRemapStores | Specifies if stores should be automatically remapped when Types are no longer consistent with the store mappings |
Methods
CreateStore(String, IDictionary<String, Type>)
Create an new store with the name given. If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(string storeName, IDictionary<string, Type> typeBag)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store to create |
System.Collections.Generic.IDictionary<System.String, System.Type> | typeBag | A type bag containing the names and Types of the properties that will be saved in the store |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
CreateStore(String, IDictionary<String, Type>, StoreDefinitionParameters)
Create an new store with the name given. If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(string storeName, IDictionary<string, Type> typeBag, StoreDefinitionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store to create |
System.Collections.Generic.IDictionary<System.String, System.Type> | typeBag | A type bag containing the names and Types of the properties that will be saved in the store |
StoreDefinitionParameters | parameters | Additional paramteres to use when created and mapping the store against the type bag |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
CreateStore(String, Type)
Creates an new store with the name given If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(string storeName, Type type)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store |
System.Type | type | The type to use to define the store |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
Remarks
The type
will be reflected to create the store definition
CreateStore(String, Type, StoreDefinitionParameters)
Creates an new store with a the name given If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(string storeName, Type type, StoreDefinitionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store |
System.Type | type | The type to use to define the store |
StoreDefinitionParameters | parameters | Additional paramteres to use when created and mapping the store against the type T |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
Remarks
The type
will be reflected to create the store definition
CreateStore(Type)
Creates an new store with a default name of type.FullName If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to use to define the store |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
Remarks
The type
will be reflected to create the store definition
CreateStore(Type, StoreDefinitionParameters)
Creates an new store with a default name of type.FullName If a store with the same name already exists then it will be returned, otherwise the store will be created.
Declaration
public override DynamicDataStore CreateStore(Type type, StoreDefinitionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to use to define the store |
StoreDefinitionParameters | parameters | Additional paramteres to use when created and mapping the store against the type |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance |
Overrides
Remarks
The type
will be reflected to create the store definition
DeleteStore(String, Boolean)
Delete the store
Declaration
public override void DeleteStore(string storeName, bool deleteObjects)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store to delete |
System.Boolean | deleteObjects | A System.Boolean indicating if all items in the store should also be deleted. If false is passed then the actual items for the store remain in the 'Big Table' used as storage for store. |
Overrides
DeleteStore(Type, Boolean)
Delete the store with the default name of type.FullName
Declaration
public override void DeleteStore(Type type, bool deleteObjects)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The System.Type to derive the store name from |
System.Boolean | deleteObjects | A System.Boolean indicating if all items in the store should also be deleted. If false is passed then the actual items for the store remain in the 'Big Table' used as storage for store. |
Overrides
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
DoRemapIfRequired(StoreDefinition, Type, StoreDefinitionParameters)
Remap the store according to the Type and StoreDefinitionParameters passed
Declaration
protected virtual StoreDefinition DoRemapIfRequired(StoreDefinition storeDefinition, Type type, StoreDefinitionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
StoreDefinition | storeDefinition | An existing store definition to check |
System.Type | type | The Type to check against |
StoreDefinitionParameters | parameters | The StoreDefinitionParameters to check against |
Returns
Type | Description |
---|---|
StoreDefinition | The existing store definition if a remap was not required, otherwise a new store definition |
GetStore(String)
Get the store with the name given. If a store does not exist for the name then null is returned.
Declaration
public override DynamicDataStore GetStore(string storeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | storeName | The name of the store to return |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance or null if the store does not exist |
Overrides
Remarks
Use the CreateStore(String, Type) method to create a new store
GetStore(Type)
Get the store with the default name of type.FullName. If a store does not exist for the name then null is returned.
If a store does not exist for the name then null is returned.
Declaration
public override DynamicDataStore GetStore(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance or null if the store does not exist |
Overrides
Remarks
Use the CreateStore(Type) method to create a new store
GetStoreForItem(Identity, String)
Return a store for an item.
This should be used in specialized situations where the store database table is known for an item but not its actual store.
Declaration
public override DynamicDataStore GetStoreForItem(Identity itemId, string storeTableName)
Parameters
Type | Name | Description |
---|---|---|
Identity | itemId | The id of the item to return the store for |
System.String | storeTableName | The name of the store table the item is stored in |
Returns
Type | Description |
---|---|
DynamicDataStore | A DynamicDataStore instance or null if the item is not found in the store table specified |
Overrides
GetStoreNameForType(Type)
Returns the store name for the type passed.
The store name resolution process for a System.Type is as follows: 1) The Type is reflected to search for a EPiServerDataStoreAttribute 2) The GlobalTypeToStoreMap is searched for an entry for the type 3) The System.Type.FullName property is used for the type
Declaration
public override string GetStoreNameForType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The System.Type to obtains a store name for |
Returns
Type | Description |
---|---|
System.String | A System.String |
Overrides
Initialize()
Initialize the instance
Declaration
public void Initialize()