Show / Hide Table of Contents

Class DatabaseTableAgent

Proxy class for the DatabaseTable Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Inheritance
object
DatabaseTableAgent
Implements
IDatabaseTableAgent
IAgent
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class DatabaseTableAgent : IDatabaseTableAgent, IAgent

Constructors

DatabaseTableAgent(ITableRecordImplementation, IMassOperationResultImplementation, ISoRequestItemsAccessor)

Proxy class for the DatabaseTable Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Declaration
public DatabaseTableAgent(ITableRecordImplementation tableRecordImplementation, IMassOperationResultImplementation massOperationResultImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type Name Description
ITableRecordImplementation tableRecordImplementation
IMassOperationResultImplementation massOperationResultImplementation
ISoRequestItemsAccessor accessor

DatabaseTableAgent(ITableRecordImplementation, IMassOperationResultImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)

Proxy class for the DatabaseTable Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Declaration
public DatabaseTableAgent(ITableRecordImplementation tableRecordImplementation, IMassOperationResultImplementation massOperationResultImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
Type Name Description
ITableRecordImplementation tableRecordImplementation
IMassOperationResultImplementation massOperationResultImplementation
ISoRequestItemsAccessor accessor
IDebugUser debugUser
IServiceCallsRepository serviceCallsRepository
IScriptingConfiguration scriptingConfiguration
IOnlineConfiguration onlineConfiguration

Methods

DeleteAsync(string, int[], CancellationToken)

Delete rows, by primary key; traveltransactionlog and WebHooks are supported

Declaration
public Task<MassOperationResult> DeleteAsync(string tableName, int[] iDs, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table where rows should be deleted

int[] iDs

Primary keys of the rows to be deleted

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<MassOperationResult>

Summary of results

DeleteRowAsync(string, int, CancellationToken)

Delete a row from a table

Declaration
public Task DeleteRowAsync(string tableName, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table to delete from; in the current release this must be an 'extratable'. Use the database name, on the form y_aTable

int id

The id of the row to delete

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

InsertAsync(string, string[], string[][], CancellationToken)

Mass-insert rows, with or without primary keys specified. Works on physical tables with no special processing for udef etc.; traveltransactionlog and WebHooks are supported

Declaration
public Task<MassOperationResult> InsertAsync(string tableName, string[] columns, string[][] data, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table where rows should be inserted

string[] columns

List of column names, in the same order as in the Data parameter

string[][] data

Outer array = rows, inner = columns in specified order; use CultureDataFormatter to format values that aren't string or int

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<MassOperationResult>

Summary of results

InsertRowAsync(string, StringDictionary, CancellationToken)

Insert a row into a table

Declaration
public Task<int> InsertRowAsync(string tableName, StringDictionary values, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table to insert into; in the current release this must be an 'extratable'. Use the database name, on the form y_aTable

StringDictionary values

A StringDictionary with the values to insert. You do not need to specify all the values in the table. The omitted ones will get default values

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<int>

The id of the newly inserted row

ReadRowAsync(string, int, CancellationToken)

Read a row from a table

Declaration
public Task<TableRecord> ReadRowAsync(string tableName, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table to fetch; in the current release this must be an 'extratable'. Use the database name, on the form y_aTable

int id

The id of the row to fetch

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<TableRecord>

The row from the table

TruncateAsync(string, CancellationToken)

Drop all rows in a table. This clearance is not individually logged in TravelTransactionlog or Webhook/script calls

Declaration
public Task<MassOperationResult> TruncateAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Name of table to be truncated

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<MassOperationResult>

Summary of results

UpdateRowAsync(string, int, StringDictionary, CancellationToken)

Update a row in a table

Declaration
public Task UpdateRowAsync(string tableName, int id, StringDictionary values, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table to update; in the current release this must be an 'extratable'. Use the database name, on the form y_aTable

int id

The id of the row to update

StringDictionary values

A StringDictionary with the values to update. You do not need to specify all the values in the table. The omitted ones will remain unchanged

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

UpsertAsync(string, string[], string[], string[][], UpsertNomatchAction, bool, CancellationToken)

Insert or update rows, optionally deleting/zeroing 'leftover' rows. Special support for UDEF, as well as optional extensive information return. Traveltransactionlog and WebHooks are supported

Declaration
public Task<MassOperationResult> UpsertAsync(string tableName, string[] columns, string[] keys, string[][] data, UpsertNomatchAction nomatchAction, bool returnRowStatus, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

The name of the table where rows should be inserted or updated

string[] columns

List of column names, in the same order as in the data

string[] keys

List of columns that are to be used as keys, to match any existing rows

string[][] data

Outer array = row, inner = column in specified order; use CultureDataFormatter to format values

UpsertNomatchAction nomatchAction

Action to take on rows in the target table, that are not matched by any rows in the incoming data. Use the deletion options with care. NEVER use deletion if your Upsert is so large you need to divide it into multiple batches.

bool returnRowStatus

If true, then the 'RowStatus' member of the return carrier will be populated with a per-row status, for each incoming row

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task<MassOperationResult>

Summary of results

Implements

IDatabaseTableAgent
IAgent
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top