Table of Contents

Interface IOrpheusTable

Namespace
OrpheusInterfaces.Core
Assembly
OrpheusInterfaces.dll

Orpheus table is the core Orpheus data object. It is responsible for performing data operations.

public interface IOrpheusTable : IDisposable
Inherited Members

Properties

BatchSize

Maximum number of rows batched into a single round trip when executing queued inserts/updates/deletes. Default: 100.

int BatchSize { get; set; }

Property Value

int

DetailTables

List of dependent detail tables.

List<IOrpheusTable> DetailTables { get; }

Property Value

List<IOrpheusTable>

List of detail tables

KeyFields

Table's key field(s).

List<IOrpheusTableKeyField> KeyFields { get; set; }

Property Value

List<IOrpheusTableKeyField>

Table's key field(s)

Level

Table's level. Zero if the table is not a child to any other table.

int Level { get; }

Property Value

int

Table's level

MasterTable

Master table name, if the table is a detail table.

IOrpheusTable MasterTable { get; set; }

Property Value

IOrpheusTable

Master table name

MasterTableKeyFields

Master table's key field(s), if the table is detail table.

List<IOrpheusTableKeyField> MasterTableKeyFields { get; }

Property Value

List<IOrpheusTableKeyField>

Master table key fields

Modified

True when table data have been modified.

bool Modified { get; }

Property Value

bool

True if table data have been modified

Name

The table name.

string Name { get; }

Property Value

string

Table name

SchemaName

The table's schema name. Applicable only if the db engine is SQL Server.

string SchemaName { get; }

Property Value

string

Methods

ClearData()

Clears existing loaded data.

void ClearData()

ExecuteDeletes(IDbTransaction)

Executes any delete changes that the table has.

void ExecuteDeletes(IDbTransaction transaction)

Parameters

transaction IDbTransaction

ExecuteInserts(IDbTransaction)

Executes any insert changes that the table has.

void ExecuteInserts(IDbTransaction transaction)

Parameters

transaction IDbTransaction

ExecuteUpdates(IDbTransaction)

Executes any update changes that the table has.

void ExecuteUpdates(IDbTransaction transaction)

Parameters

transaction IDbTransaction

GetKeyValues()

Returns list of current key values.

List<KeyValuePair<string, object>> GetKeyValues()

Returns

List<KeyValuePair<string, object>>

List of current key values

Load(Dictionary<string, List<object>>, LogicalOperator, bool)

Loads records from the DB to the table. You can configure having multiple fields and multiple values per field. Multiple field values are bound with a logical OR. Multiple fields by default are bound with a logical OR. Defining a logical operator, you can change the default behavior.

void Load(Dictionary<string, List<object>> keyValues, LogicalOperator logicalOperator = LogicalOperator.loOR, bool clearExistingData = true)

Parameters

keyValues Dictionary<string, List<object>>
logicalOperator LogicalOperator
clearExistingData bool

Load(List<object>, bool)

Loads records from the DB to the table.

void Load(List<object> keyValues = null, bool clearExistingData = true)

Parameters

keyValues List<object>
clearExistingData bool

Load(IDbCommand, bool)

Loads table data by executing a db command.

void Load(IDbCommand dbCommand, bool clearExistingData = true)

Parameters

dbCommand IDbCommand
clearExistingData bool

Load(string, bool)

Loads table data by executing a SQL command.

void Load(string SQL, bool clearExistingData = true)

Parameters

SQL string

SQL command to be executed

clearExistingData bool

Save(IDbTransaction, bool)

Save changes to the database.

void Save(IDbTransaction dbTransaction = null, bool commitTransaction = true)

Parameters

dbTransaction IDbTransaction

Transaction in which the commands will be executed

commitTransaction bool

Commit transaction after save.

Events

OnAfterSave

Occurs after the transaction has been committed.

event EventHandler<ISaveEventArguments> OnAfterSave

Event Type

EventHandler<ISaveEventArguments>

OnBeforeSave

Occurs before records are save in the database.

event EventHandler<ISaveEventArguments> OnBeforeSave

Event Type

EventHandler<ISaveEventArguments>