Show / Hide Table of Contents

    Class TransactionalDictionary<TKey, TValue>

    Wraps the changes being made to the underlying Dictionary<TKey, TValue> into a transaction.

    Inheritance
    object
    TransactionalDictionary<TKey, TValue>
    InMemoryOffsetStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Util
    Assembly: Silverback.Integration.dll
    Syntax
    public abstract class TransactionalDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey

    The type of the keys in the dictionary.

    TValue

    The type of the values in the dictionary.

    Constructors

    | Improve this doc View source

    TransactionalDictionary(TransactionalDictionarySharedItems<TKey, TValue>)

    Initializes a new instance of the TransactionalDictionary<TKey, TValue> class.

    Declaration
    protected TransactionalDictionary(TransactionalDictionarySharedItems<TKey, TValue> sharedItems)
    Parameters
    Type Name Description
    TransactionalDictionarySharedItems<TKey, TValue> sharedItems

    The dictionary items that are persisted and shared between the instances of this class.

    Properties

    | Improve this doc View source

    CommittedItemsCount

    Gets the number of items currently in the dictionary, ignoring the uncommitted changes.

    Declaration
    public int CommittedItemsCount { get; }
    Property Value
    Type Description
    int
    | Improve this doc View source

    Items

    Gets the underlying Dictionary<TKey, TValue> containing the persisted items.

    Declaration
    protected Dictionary<TKey, TValue> Items { get; }
    Property Value
    Type Description
    Dictionary<TKey, TValue>
    | Improve this doc View source

    UncommittedItems

    Gets the Dictionary<TKey, TValue> containing the pending items that will be persisted when Commit is called.

    Declaration
    protected Dictionary<TKey, TValue> UncommittedItems { get; }
    Property Value
    Type Description
    Dictionary<TKey, TValue>

    Methods

    | Improve this doc View source

    AddOrReplaceAsync(TKey, TValue)

    Adds or replaces an item in the dictionary.

    Declaration
    protected Task AddOrReplaceAsync(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key

    The item key.

    TValue value

    The item value.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    CommitAsync()

    Called to commit the pending changes.

    Declaration
    public virtual Task CommitAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    RemoveAsync(TKey)

    Removes the item with the specified key.

    Declaration
    protected Task RemoveAsync(TKey key)
    Parameters
    Type Name Description
    TKey key

    The item key.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    RollbackAsync()

    Called to rollback the pending changes.

    Declaration
    public virtual Task RollbackAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini