Show / Hide Table of Contents

Class InMemoryDataContext

Client data context managing.

Inheritance
System.Object
System.Dynamic.DynamicObject
ExpandoBase
Expando
Context
DataContextBase
InMemoryDataContext
DtoDataContext
Implements
IDataContext
IContext
IExpando
System.Dynamic.IDynamicMetaObjectProvider
IIndexable
ILoggable
IIdentifiable
System.IDisposable
IInitializable
Inherited Members
DataContextBase.InitializationMonitor
DataContextBase.Id
DataContextBase.EntityActivator
DataContextBase.Initialize(IContext)
DataContextBase.Query<T>(IQueryOperationContext)
DataContextBase.CreateCommand(Type)
DataContextBase.Attach(Object)
DataContextBase.Detach(IEntityEntry)
DataContextBase.GetIdEqualityExpression<T>(Object)
DataContextBase.CreateEntityEntry(Object, Nullable<ChangeState>)
DataContextBase.AttachCore(Object, Boolean)
DataContextBase.ResolveAttachConflict(IEntityEntry, Object, Boolean)
DataContextBase.DetachCore(IEntityEntry, Boolean)
Context.AmbientServices
Context.CompositionContext
Context.Identity
Context.Logger
Context.Dispose()
Context.ValidateIdentity(IIdentity, IIdentity)
Context.SetCompositionContext(ICompositionContext)
Context.SetAmbientServices(IAmbientServices)
ExpandoBase.Item[String]
ExpandoBase.GetDynamicMemberNames()
ExpandoBase.HasDynamicMember(String)
ExpandoBase.TryGetMember(GetMemberBinder, Object)
ExpandoBase.TrySetMember(SetMemberBinder, Object)
ExpandoBase.TryInvokeMember(InvokeMemberBinder, Object[], Object)
ExpandoBase.ToDictionary(Func<String, String>, Func<Object, Object>)
ExpandoBase.GetInnerObjectTypeInfo()
ExpandoBase.GetThisTypeInfo()
ExpandoBase.TryGetValue(String, Object)
ExpandoBase.TrySetValue(String, Object)
System.Dynamic.DynamicObject.GetMetaObject(System.Linq.Expressions.Expression)
System.Dynamic.DynamicObject.TryBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Object, System.Object)
System.Dynamic.DynamicObject.TryConvert(System.Dynamic.ConvertBinder, System.Object)
System.Dynamic.DynamicObject.TryCreateInstance(System.Dynamic.CreateInstanceBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryDeleteIndex(System.Dynamic.DeleteIndexBinder, System.Object[])
System.Dynamic.DynamicObject.TryDeleteMember(System.Dynamic.DeleteMemberBinder)
System.Dynamic.DynamicObject.TryGetIndex(System.Dynamic.GetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TrySetIndex(System.Dynamic.SetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryUnaryOperation(System.Dynamic.UnaryOperationBinder, System.Object)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Data.InMemory
Assembly: Kephas.Data.dll
Syntax
[SupportedDataStoreKinds(new DataStoreKind[]{DataStoreKind.InMemory})]
public class InMemoryDataContext : DataContextBase, IDataContext, IContext, IExpando, IDynamicMetaObjectProvider, IIndexable, ILoggable, IIdentifiable, IDisposable, IInitializable
Remarks

For the connection string, use something like in the example below: ConnectionString=UseSharedCache=true|false;InitialData=(JSON serialized data).

Constructors

| Improve this Doc View Source

InMemoryDataContext(ICompositionContext, IDataCommandProvider, IDataBehaviorProvider, ISerializationService)

Initializes a new instance of the InMemoryDataContext class.

Declaration
public InMemoryDataContext(ICompositionContext compositionContext, IDataCommandProvider dataCommandProvider, IDataBehaviorProvider dataBehaviorProvider, ISerializationService serializationService)
Parameters
Type Name Description
ICompositionContext compositionContext

The composition context.

IDataCommandProvider dataCommandProvider

The data command provider.

IDataBehaviorProvider dataBehaviorProvider

The data behavior provider.

ISerializationService serializationService

The serialization service.

Properties

| Improve this Doc View Source

LocalCache

Gets the local cache where the session entities are stored.

Declaration
protected override IDataContextCache LocalCache { get; }
Property Value
Type Description
IDataContextCache

The local cache.

Overrides
DataContextBase.LocalCache
| Improve this Doc View Source

SerializationService

Gets the serialization service.

Declaration
public ISerializationService SerializationService { get; }
Property Value
Type Description
ISerializationService

The serialization service.

| Improve this Doc View Source

UseSharedCache

Gets a value indicating whether to use the shared cache or not.

Declaration
protected bool UseSharedCache { get; }
Property Value
Type Description
System.Boolean

True if shared cache is used, false if not.

Methods

| Improve this Doc View Source

Dispose(Boolean)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

true to release both managed and unmanaged resources; falsefalse to release only unmanaged resources.

Overrides
Context.Dispose(Boolean)
| Improve this Doc View Source

GetEntityEntry(Object)

Gets the entity extended information.

Declaration
public override IEntityEntry GetEntityEntry(object entity)
Parameters
Type Name Description
System.Object entity

The entity.

Returns
Type Description
IEntityEntry

The entity extended information.

Overrides
DataContextBase.GetEntityEntry(Object)
| Improve this Doc View Source

Initialize(IDataInitializationContext)

Initializes the InMemoryDataContext.

Declaration
protected override void Initialize(IDataInitializationContext dataInitializationContext)
Parameters
Type Name Description
IDataInitializationContext dataInitializationContext

The data initialization context.

Overrides
DataContextBase.Initialize(IDataInitializationContext)
| Improve this Doc View Source

QueryCore<T>(IQueryOperationContext)

Gets a query over the entity type for the given query operationContext, if any is provided.

Declaration
protected override IQueryable<T> QueryCore<T>(IQueryOperationContext queryOperationContext)

    where T : class
Parameters
Type Name Description
IQueryOperationContext queryOperationContext

Context for the query.

Returns
Type Description
System.Linq.IQueryable<T>

A query over the entity type.

Type Parameters
Name Description
T

The entity type.

Overrides
DataContextBase.QueryCore<T>(IQueryOperationContext)

Implements

IDataContext
IContext
IExpando
System.Dynamic.IDynamicMetaObjectProvider
IIndexable
ILoggable
IIdentifiable
System.IDisposable
IInitializable

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
MessageBrokerExtensions.CreateBrokeredMessageBuilder(IContext)
ContextExtensions.InitialData(IContext)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<(Object entity, ChangeState changeState)>)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<Object>)
ContextExtensions.WithInitialData<TContext>(TContext, IEnumerable<IChangeStateTrackableEntityEntry>)
DataContextExtensions.Detach(IDataContext, Object)
DataContextExtensions.CreateCommand<TCommand>(IDataContext)
DataContextExtensions.CreateAsync(IDataContext, Type, CancellationToken)
DataContextExtensions.CreateAsync(IDataContext, ICreateEntityContext, CancellationToken)
DataContextExtensions.CreateAsync<T>(IDataContext, CancellationToken)
DataContextExtensions.CreateAsync<T>(IDataContext, ICreateEntityContext, CancellationToken)
DataContextExtensions.FindAsync(IDataContext, Type, Object, Boolean, CancellationToken)
DataContextExtensions.FindAsync(IDataContext, IFindContext, CancellationToken)
DataContextExtensions.FindAsync<T>(IDataContext, IFindContext, CancellationToken)
DataContextExtensions.FindAsync<T>(IDataContext, Object, Boolean, CancellationToken)
DataContextExtensions.FindOneAsync(IDataContext, IFindOneContext, CancellationToken)
DataContextExtensions.FindOneAsync<T>(IDataContext, IFindOneContext, CancellationToken)
DataContextExtensions.FindOneAsync<T>(IDataContext, Expression<Func<T, Boolean>>, Boolean, CancellationToken)
DataContextExtensions.PersistChangesAsync(IDataContext, IPersistChangesContext, CancellationToken)
DataContextExtensions.DiscardChanges(IDataContext)
DataContextExtensions.Delete<T>(IDataContext, T[])
DataContextExtensions.Delete<T>(IDataContext, IEnumerable<T>)
DataContextExtensions.BulkDeleteAsync(IDataContext, IBulkDeleteContext, CancellationToken)
DataContextExtensions.BulkDeleteAsync<T>(IDataContext, Expression<Func<T, Boolean>>, Boolean, CancellationToken)
DataContextExtensions.BulkUpdateAsync<T>(IDataContext, Expression<Func<T, Boolean>>, Object, Boolean, CancellationToken)
DataContextExtensions.BulkUpdateAsync(IDataContext, IBulkUpdateContext, CancellationToken)
DataContextExtensions.ExecuteAsync(IDataContext, String, CancellationToken)
DataContextExtensions.ExecuteAsync(IDataContext, IExecuteContext, CancellationToken)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX