Show / Hide Table of Contents

    Class UnitOfWork

    Class that represents a unit of work for the Fibula project. All operations that persist data to whatever the underlying storage is, should be done within the same unit of work and persisted at the end of it by invoking Complete().

    Inheritance
    System.Object
    UnitOfWork
    Implements
    IUnitOfWork<AccountRepository, CharacterRepository, MonsterTypeReadOnlyRepository, ItemTypeReadOnlyRepository>
    System.IDisposable
    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: Fibula.Common
    Assembly: Fibula.Common.dll
    Syntax
    public class UnitOfWork : IUnitOfWork<AccountRepository, CharacterRepository, MonsterTypeReadOnlyRepository, ItemTypeReadOnlyRepository>, IDisposable

    Constructors

    | Improve this Doc View Source

    UnitOfWork(IApplicationContext, IItemTypeLoader, IMonsterTypeLoader)

    Initializes a new instance of the UnitOfWork class.

    Declaration
    public UnitOfWork(IApplicationContext applicationContext, IItemTypeLoader itemTypeLoader, IMonsterTypeLoader monsterTypeLoader)
    Parameters
    Type Name Description
    IApplicationContext applicationContext

    The application context to work in.

    IItemTypeLoader itemTypeLoader

    A reference to the item type loader in use.

    IMonsterTypeLoader monsterTypeLoader

    A reference to the monster type loader in use.

    Properties

    | Improve this Doc View Source

    Accounts

    Gets a reference to the accounts repository.

    Declaration
    public AccountRepository Accounts { get; }
    Property Value
    Type Description
    AccountRepository
    | Improve this Doc View Source

    Characters

    Gets a reference to the characters repository.

    Declaration
    public CharacterRepository Characters { get; }
    Property Value
    Type Description
    CharacterRepository
    | Improve this Doc View Source

    ItemTypes

    Gets a reference to the item types repository.

    Declaration
    public ItemTypeReadOnlyRepository ItemTypes { get; }
    Property Value
    Type Description
    ItemTypeReadOnlyRepository
    | Improve this Doc View Source

    MonsterTypes

    Gets a reference to the monster types repository.

    Declaration
    public MonsterTypeReadOnlyRepository MonsterTypes { get; }
    Property Value
    Type Description
    MonsterTypeReadOnlyRepository

    Methods

    | Improve this Doc View Source

    Complete()

    Completes this unit of work.

    Declaration
    public int Complete()
    Returns
    Type Description
    System.Int32

    The number of changes saved upon completion of this unit of work.

    | Improve this Doc View Source

    Dispose()

    Disposes this unit of work and it's resources.

    Declaration
    public void Dispose()

    Implements

    IUnitOfWork<TAccountsRepository, TCharactersRepository, TMonsterTypesRepository, TItemTypesRepository>
    System.IDisposable

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.