Show / Hide Table of Contents

Class DataContextCache

A basic implementation of a data context cache.

Inheritance
System.Object
DataContextCache
SharedDataContextCache
Implements
IDataContextCache
System.Collections.Generic.IDictionary<System.Object, IEntityEntry>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry>>
System.Collections.IEnumerable
Inherited Members
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.Caching
Assembly: Kephas.Data.dll
Syntax
public class DataContextCache : IDataContextCache, IDictionary<object, IEntityEntry>, ICollection<KeyValuePair<object, IEntityEntry>>, IEnumerable<KeyValuePair<object, IEntityEntry>>, IEnumerable

Constructors

| Improve this Doc View Source

DataContextCache()

Initializes a new instance of the DataContextCache class.

Declaration
public DataContextCache()
| Improve this Doc View Source

DataContextCache(IDictionary<Object, IEntityEntry>, IDictionary<Object, IEntityEntry>)

Initializes a new instance of the DataContextCache class.

Declaration
protected DataContextCache(IDictionary<object, IEntityEntry> items, IDictionary<object, IEntityEntry> entityEntryMappings)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.Object, IEntityEntry> items

The items.

System.Collections.Generic.IDictionary<System.Object, IEntityEntry> entityEntryMappings

The entity entry mappings.

Properties

| Improve this Doc View Source

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

The number of elements contained in the System.Collections.Generic.ICollection<T>.

| Improve this Doc View Source

Item[Object]

Gets or sets the element with the specified key.

Declaration
public IEntityEntry this[object key] { get; set; }
Parameters
Type Name Description
System.Object key

The key of the element to get or set.

Property Value
Type Description
IEntityEntry

The element with the specified key.

| Improve this Doc View Source

Keys

Gets an System.Collections.Generic.ICollection<T> containing the keys of the System.Collections.Generic.IDictionary<TKey, TValue>.

Declaration
public ICollection<object> Keys { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<System.Object>

An System.Collections.Generic.ICollection<T> containing the keys of the object that implements System.Collections.Generic.IDictionary<TKey, TValue>.

| Improve this Doc View Source

Values

Gets an System.Collections.Generic.ICollection<T> containing the values in the System.Collections.Generic.IDictionary<TKey, TValue>.

Declaration
public ICollection<IEntityEntry> Values { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<IEntityEntry>

An System.Collections.Generic.ICollection<T> containing the values in the object that implements System.Collections.Generic.IDictionary<TKey, TValue>.

Methods

| Improve this Doc View Source

Add(IEntityEntry)

Adds an IEntityEntry to the IDataContextCache.

Declaration
public virtual void Add(IEntityEntry value)
Parameters
Type Name Description
IEntityEntry value

The object to add.

| Improve this Doc View Source

Clear()

Removes all items from the System.Collections.Generic.ICollection<T>.

Declaration
public virtual void Clear()
| Improve this Doc View Source

ContainsKey(Object)

Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.

Declaration
public virtual bool ContainsKey(object key)
Parameters
Type Name Description
System.Object key

The key to locate in the System.Collections.Generic.IDictionary<TKey, TValue>.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the key; otherwise, false.

| Improve this Doc View Source

CopyTo(KeyValuePair<Object, IEntityEntry>[], Int32)

Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.

Declaration
public void CopyTo(KeyValuePair<object, IEntityEntry>[] array, int arrayIndex)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry>[] array

The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

| Improve this Doc View Source

GetEntityEntry(Object)

Gets the entity entry associated to the provided entity, or null if none could be found.

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

The entity.

Returns
Type Description
IEntityEntry

The entity entry or null.

| Improve this Doc View Source

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<KeyValuePair<object, IEntityEntry>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry>>

An enumerator that can be used to iterate through the collection.

| Improve this Doc View Source

Remove(IEntityEntry)

Removes an IEntityEntry from the IDataContextCache.

Declaration
public virtual bool Remove(IEntityEntry value)
Parameters
Type Name Description
IEntityEntry value

The object to remove.

Returns
Type Description
System.Boolean

true if the removal succeeds, false otherwise.

| Improve this Doc View Source

Remove(Object)

Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>.

Declaration
public bool Remove(object key)
Parameters
Type Name Description
System.Object key

The key of the element to remove.

Returns
Type Description
System.Boolean

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original System.Collections.Generic.IDictionary<TKey, TValue>.

| Improve this Doc View Source

TryGetValue(Object, out IEntityEntry)

Gets the value associated with the specified key.

Declaration
public virtual bool TryGetValue(object key, out IEntityEntry value)
Parameters
Type Name Description
System.Object key

The key whose value to get.

IEntityEntry value

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns
Type Description
System.Boolean

true if the object that implements System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.

Explicit Interface Implementations

| Improve this Doc View Source

ICollection<KeyValuePair<Object, IEntityEntry>>.Add(KeyValuePair<Object, IEntityEntry>)

Adds an item to the System.Collections.Generic.ICollection<T>.

Declaration
void ICollection<KeyValuePair<object, IEntityEntry>>.Add(KeyValuePair<object, IEntityEntry> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry> item

The object to add to the System.Collections.Generic.ICollection<T>.

| Improve this Doc View Source

ICollection<KeyValuePair<Object, IEntityEntry>>.Contains(KeyValuePair<Object, IEntityEntry>)

Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.

Declaration
bool ICollection<KeyValuePair<object, IEntityEntry>>.Contains(KeyValuePair<object, IEntityEntry> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry> item

The object to locate in the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item is found in the System.Collections.Generic.ICollection<T>; otherwise, false.

| Improve this Doc View Source

ICollection<KeyValuePair<Object, IEntityEntry>>.IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.

Declaration
bool ICollection<KeyValuePair<object, IEntityEntry>>.IsReadOnly { get; }
Returns
Type Description
System.Boolean

true if the System.Collections.Generic.ICollection<T> is read-only; otherwise, false.

| Improve this Doc View Source

ICollection<KeyValuePair<Object, IEntityEntry>>.Remove(KeyValuePair<Object, IEntityEntry>)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.

Declaration
bool ICollection<KeyValuePair<object, IEntityEntry>>.Remove(KeyValuePair<object, IEntityEntry> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<System.Object, IEntityEntry> item

The object to remove from the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item was successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection<T>.

| Improve this Doc View Source

IDictionary<Object, IEntityEntry>.Add(Object, IEntityEntry)

Adds an element with the provided key and value to the System.Collections.Generic.IDictionary<TKey, TValue>.

Declaration
void IDictionary<object, IEntityEntry>.Add(object key, IEntityEntry value)
Parameters
Type Name Description
System.Object key

The object to use as the key of the element to add.

IEntityEntry value

The object to use as the value of the element to add.

Exceptions
Type Condition
System.ArgumentNullException

key is null.

System.ArgumentException

An element with the same key already exists in the System.Collections.Generic.IDictionary<TKey, TValue>.

System.NotSupportedException

The System.Collections.Generic.IDictionary<TKey, TValue> is read-only.

| Improve this Doc View Source

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.

Implements

IDataContextCache
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

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>)
DictionaryExtensions.TryGetValue<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue)
EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX