Class DataSpace
Container class for data contexts indexed by contained entity types.
Implements
Inherited Members
Namespace: Kephas.Data
Assembly: Kephas.Data.dll
Syntax
public class DataSpace : Context, IDataSpace, IContext, IExpando, IDynamicMetaObjectProvider, IIndexable, ILoggable, IReadOnlyCollection<IDataContext>, IEnumerable<IDataContext>, IEnumerable, IDisposable, IInitializable
Constructors
| Improve this Doc View SourceDataSpace(ICompositionContext, IDataContextFactory, IDataStoreProvider)
Initializes a new instance of the DataSpace class.
Declaration
public DataSpace(ICompositionContext compositionContext, IDataContextFactory dataContextFactory, IDataStoreProvider dataStoreProvider)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | Context for the composition. |
IDataContextFactory | dataContextFactory | The data context factory. |
IDataStoreProvider | dataStoreProvider | The data store provider. |
DataSpace(ICompositionContext, IDataContextFactory, IDataStoreProvider, Boolean)
Initializes a new instance of the DataSpace class.
Declaration
protected DataSpace(ICompositionContext compositionContext, IDataContextFactory dataContextFactory, IDataStoreProvider dataStoreProvider, bool isThreadSafe)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | Context for the composition. |
IDataContextFactory | dataContextFactory | The data context factory. |
IDataStoreProvider | dataStoreProvider | The data store provider. |
System.Boolean | isThreadSafe | True if this object is thread safe. |
Properties
| Improve this Doc View SourceCount
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of elements in the collection. |
Methods
| Improve this Doc View SourceClearDataContextMap()
Clears the data context map.
Declaration
protected virtual void ClearDataContextMap()
Dispose(Boolean)
Releases the unmanaged resources used by the Kephas.Services.Context and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
| Improve this Doc View SourceGetDataContext(ITypeInfo, IContext)
Gets the data context for the provided entity type.
Declaration
protected virtual IDataContext GetDataContext(ITypeInfo entityType, IContext context)
Parameters
Type | Name | Description |
---|---|---|
ITypeInfo | entityType | Type of the entity. |
IContext | context | Optional. The context. |
Returns
Type | Description |
---|---|
IDataContext | The data context. |
GetDataContext(Type, IContext)
Gets the data context for the provided entity type.
Declaration
protected virtual IDataContext GetDataContext(Type entityType, IContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Type | entityType | Type of the entity. |
IContext | context | Optional. The context. |
Returns
Type | Description |
---|---|
IDataContext | The data context. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<IDataContext> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<IDataContext> | An enumerator that can be used to iterate through the collection. |
Initialize(IContext)
Initializes the service.
Declaration
public virtual void Initialize(IContext context = null)
Parameters
Type | Name | Description |
---|---|---|
IContext | context | An optional context for initialization. |
Explicit Interface Implementations
| Improve this Doc View SourceIDataSpace.Item[ITypeInfo, IContext]
Gets the data context for the provided entity type.
Declaration
IDataContext IDataSpace.this[ITypeInfo entityType, IContext context] { get; }
Parameters
Type | Name | Description |
---|---|---|
ITypeInfo | entityType | Type of the entity. |
IContext | context | Optional. The context. |
Returns
Type | Description |
---|---|
IDataContext | The data context. |
IDataSpace.Item[Type, IContext]
Gets the data context for the provided entity type.
Declaration
IDataContext IDataSpace.this[Type entityType, IContext context] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Type | entityType | Type of the entity. |
IContext | context | Optional. The context. |
Returns
Type | Description |
---|---|
IDataContext | The data context. |
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |