C# Class Core.DataBase.Helpers.DataRepositoryInMemory

Handles connections to and actions over an in-memory database.
Inheritance: LoggerFluency, IDataRepository
ファイルを表示 Open project: VitaliiAndreev/WarThunder_PresetRandomizer

Protected Properties

Property Type Description
_lock object

Public Methods

Method Description
AddToNewObjects ( newObject ) : void
ClearNewObjects ( ) : void
CommitChanges ( IPersistentObject instance ) : void

Commits any changes to a specified object to the database.

DataRepositoryInMemory ( ) : Core.DataBase.Enumerations.Logger

Creates a new repository, as well as creates and configures a ISessionFactory for it.

Dispose ( ) : void

Releases unmanaged resources.

GetNewObjects ( ) : IEnumerable
PersistNewObjects ( ) : void

Persists any transient objects cached in the repository.

Query ( Func filter = null ) : IEnumerable

Reads instances (filtered if needed) of a specified persistent class from the database and caches them into a collection.

RemoveFromNewObjects ( IPersistentObject newObject ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged resources.

GetObjects ( ) : IEnumerable

Private Methods

Method Description
InitializeNonPersistentFields ( instance ) : void

Initializes non-persistent fields of a persistent object. This method is required to finalize reading from a database.

Method Details

AddToNewObjects() public method

public AddToNewObjects ( newObject ) : void
return void

ClearNewObjects() public method

public ClearNewObjects ( ) : void
return void

CommitChanges() public method

Commits any changes to a specified object to the database.
public CommitChanges ( IPersistentObject instance ) : void
instance IPersistentObject the object instance to create/update.
return void

DataRepositoryInMemory() public method

Creates a new repository, as well as creates and configures a ISessionFactory for it.
public DataRepositoryInMemory ( ) : Core.DataBase.Enumerations.Logger
return Core.DataBase.Enumerations.Logger

Dispose() public method

Releases unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged resources.
protected Dispose ( bool disposing ) : void
disposing bool Indicates whether this method is being called from .
return void

GetNewObjects() public method

public GetNewObjects ( ) : IEnumerable
return IEnumerable

GetObjects() protected method

protected GetObjects ( ) : IEnumerable
return IEnumerable

PersistNewObjects() public method

Persists any transient objects cached in the repository.
public PersistNewObjects ( ) : void
return void

Query() public method

Reads instances (filtered if needed) of a specified persistent class from the database and caches them into a collection.
public Query ( Func filter = null ) : IEnumerable
filter Func The filter by which to query objects from the database.
return IEnumerable

RemoveFromNewObjects() public method

public RemoveFromNewObjects ( IPersistentObject newObject ) : void
newObject IPersistentObject
return void

Property Details

_lock protected_oe property

protected object _lock
return object