Class RowCacheBase<Row>
Base class for caches build over HDB rows.
Inheritance
RowCacheBase<Row>
Inherited Members
Namespace: SuperOffice.CRM.Cache
Assembly: SoDataBase.dll
Syntax
public abstract class RowCacheBase<Row> : CacheBase, IDisposable, IFlushable where Row : TableRowBase
Type Parameters
Name | Description |
---|---|
Row | Type of HDB Row cached. |
Constructors
RowCacheBase(String, Int32)
Default constructor for CacheBase
Declaration
protected RowCacheBase(string name, int timeout)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the cache. |
Int32 | timeout | Timeout in [s] for the cache to expire. |
Remarks
Classes inheriting this class should only be instantiated through the
Exceptions
Type | Condition |
---|---|
SecurityException | This exception will be thrown if not above elements in the call stack is saved with the SuperOffice strong name. |
Properties
Rows
All rows currently in cache
Declaration
protected Dictionary<int, Row>.ValueCollection Rows { get; }
Property Value
Type | Description |
---|---|
Dictionary.ValueCollection<> |
Methods
AddRow(Row)
Declaration
protected virtual void AddRow(Row row)
Parameters
Type | Name | Description |
---|---|---|
Row | row |
FetchRows()
Fetch the rows from the database.
Declaration
protected abstract TableRowsBase FetchRows()
Returns
Type | Description |
---|---|
TableRowsBase | Rows fetched from the database. |
GetRowFromId(Int32)
Get the row from it's primary key.
Declaration
public Row GetRowFromId(int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Primary key of the row. |
Returns
Type | Description |
---|---|
Row | The row with the given primary key. If the row does not exist, nothing is returned. |
OnFlush()
Flush the content of the cache.
Declaration
protected override void OnFlush()
Overrides
OnParseRow(Row)
Event raised for each row fetched, so additional caching can be performed.
Declaration
protected virtual void OnParseRow(Row row)
Parameters
Type | Name | Description |
---|---|---|
Row | row |
OnRefresh()
Refresh the contents of the cache.
Declaration
protected override void OnRefresh()
Overrides
Implements
Extension Methods
EnumUtil.MapEnums<From, To>(From)