Class LLBLGenCache
The context cache for LLBLGen.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Data.LLBLGen
Assembly: Kephas.Data.LLBLGen.dll
Syntax
public class LLBLGenCache : Context, IDataContextCache, IDictionary<object, IEntityEntry>, ICollection<KeyValuePair<object, IEntityEntry>>, IEnumerable<KeyValuePair<object, IEntityEntry>>, IEnumerable
Constructors
| Improve this Doc View SourceLLBLGenCache()
Initializes a new instance of the LLBLGenCache class.
Declaration
public LLBLGenCache()
LLBLGenCache(IDictionary<Object, IEntityEntry>, IDictionary<Guid, IEntityEntry>)
Initializes a new instance of the LLBLGenCache class.
Declaration
protected LLBLGenCache(IDictionary<object, IEntityEntry> items, IDictionary<Guid, IEntityEntry> entityEntryMappings)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Object, IEntityEntry> | items | The items. |
System.Collections.Generic.IDictionary<System.Guid, IEntityEntry> | entityEntryMappings | The entity information mappings. |
Properties
| Improve this Doc View SourceCount
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>. |
EntityInfoFactory
Gets or sets the entity information factory.
Declaration
protected Func<object, IEntityEntry> EntityInfoFactory { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Object, IEntityEntry> |
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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. |
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>. |
NewEntities
The new entities.
Declaration
protected Dictionary<Guid, IEntityCore> NewEntities { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Guid, SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore> |
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 SourceAdd(IEntityEntry)
Adds an IEntityEntry to the IDataContextCache.
Declaration
public void Add(IEntityEntry value)
Parameters
Type | Name | Description |
---|---|---|
IEntityEntry | value | The object to add. |
AddCore(IEntityEntry)
Adds an entity info to the internal dictionaries.
Declaration
protected virtual void AddCore(IEntityEntry value)
Parameters
Type | Name | Description |
---|---|---|
IEntityEntry | value | The object to use as the value of the element to add. |
ContainsKey(Object)
Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.
Declaration
public 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 |
|
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 virtual 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 |
CreateEntityInfo(Object)
Creates entity information.
Declaration
protected virtual IEntityEntry CreateEntityInfo(object entity)
Parameters
Type | Name | Description |
---|---|---|
System.Object | entity | The entity. |
Returns
Type | Description |
---|---|
IEntityEntry | The new entity information. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the requested operation is invalid. |
GetEntityEntry(Object)
Gets the entity information 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 information or |
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. |
OnAddComplete<TEntity>(TEntity)
Called at the end of Add(TEntity).
Declaration
protected override void OnAddComplete<TEntity>(TEntity toAdd)
where TEntity : class, IEntityCore
Parameters
Type | Name | Description |
---|---|---|
TEntity | toAdd | To add. |
Type Parameters
Name | Description |
---|---|
TEntity | The type of the entity. |
Overrides
OnClearComplete()
Called at the end of the Clear() method.
Declaration
protected override void OnClearComplete()
Overrides
OnRemoveComplete(IEntityCore)
Called at the end of Remove(IEntityCore), when toRemove has been removed from this context.
Declaration
protected override void OnRemoveComplete(IEntityCore toRemove)
Parameters
Type | Name | Description |
---|---|---|
SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore | toRemove | To remove. |
Overrides
Remove(IEntityEntry)
Removes an IEntityEntry from the IDataContextCache.
Declaration
public bool Remove(IEntityEntry value)
Parameters
Type | Name | Description |
---|---|---|
IEntityEntry | value | The object to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remove(Object)
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public virtual bool Remove(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
|
RemoveCore(IEntityEntry)
Removes the entity info from the internal dictionaries.
Declaration
protected virtual bool RemoveCore(IEntityEntry value)
Parameters
Type | Name | Description |
---|---|---|
IEntityEntry | value | The object to remove. |
Returns
Type | Description |
---|---|
System.Boolean | True if it succeeds, false if it fails. |
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 |
Returns
Type | Description |
---|---|
System.Boolean |
|
Explicit Interface Implementations
| Improve this Doc View SourceICollection<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>. |
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 |
|
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 |
|
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 |
|
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. |
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. |