IDataServices

Allows implementation data services for domain models.

Namespace:
Inetdev.Data
Type:
Interface
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
Yes

Properties

Alias

Get the alias of the database table.

Signature:
public String Alias { get; }

CommandBuilder

Get or set the engine service command builder.

Signature:
public IDbCmdBuilder CommandBuilder { get; set; }

DataAccessAPI

Get or set the DataAccess interface object.

Signature:
public IDbAccess DataAccessAPI { get; set; }

DataModelAuditor

Get or set the data update logger object.

Signature:
public IDataModelAuditor DataModelAuditor { get; set; }

DataModelCmdBuilder

Get or set the SQL bulder object.

Signature:
public IDataModelCmdBuilder DataModelCmdBuilder { get; set; }

Fields

Get a list that contains the definition of table fields.

Signature:
public IDictionary<String, Field> Fields { get; set; }

Schema

Get or set the schema or owner of database objects.

Signature:
public String Schema { get; set; }

SequenceName

Get or set the name of the sequence to use.

Signature:
public String SequenceName { get; set; }

StringToDbTypeConverter

Converts string to object of a specified DbType.

Signature:
public IStringToDbTypeConverter StringToDbTypeConverter { get; set; }

Table

Get the table name.

Signature:
public String Table { get; }

Methods

AppendFilterTerms

Appends to the where clause all set terms.

Signature:
public Void AppendFilterTerms(statement, terms, match)
Parameters
Name Type Summary
statement Statement Statement to add terms.
terms List<Term> A collections of terms.
match MatchKind How to match the terms.

AppendStaticTerms

Appends to the where clause all set static terms.

Signature:
public Void AppendStaticTerms(statement, terms)
Parameters
Name Type Summary
statement Statement Statement to add terms.
terms List<StaticTerm> A collections of terms.

Delete

Deletes a record from the underlaying data source.

Signature:
public Int32 Delete(model, timestampKind, expectedTimestamp)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to delete.
timestampKind TimestampKind Kind of timestamp to apply on the WHERE clause.
expectedTimestamp DateTime Timestamp that is expected to be on the database.

DeleteAsync

Deletes a record from the underlaying data source asyncronously.

Signature:
public Task<Int32> DeleteAsync(model, timestampKind, expectedTimestamp)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to delete.
timestampKind TimestampKind Kind of timestamp to apply on the WHERE clause.
expectedTimestamp DateTime Timestamp that is expected to be on the database.

GetModel

Gets a domain model object of dataModelType looking for it's primary key.

Signature:
public IDataModel GetModel(dataModelType, model)
Returns

An initialized data model object.

Parameters
Name Type Summary
dataModelType Type The Type of the domain model object to retrieve.
model IDataModel An IDataModel holding the primary key to look for.

GetModel

Gets a model object of type looking for it primary key in the underlying repository.

Signature:
public GetModel<T>(model)
Returns

An initialized data model object.

Parameters
Name Type Summary
model T An instance of the model object with the primary key data.

GetModelAsync

Gets a domain model object of dataModelType looking for it's primary key.

Signature:
public Task<IDataModel> GetModelAsync(dataModelType, model)
Returns

An initialized data model object.

Parameters
Name Type Summary
dataModelType Type The Type of the domain model object to retrieve.
model IDataModel An IDataModel holding the primary key to look for.

GetModelAsync

Gets a model object of type looking for it primary key in the underlying repository.

Signature:
public Task GetModelAsync<T>(model)
Returns

An initialized data model object.

Parameters
Name Type Summary
model T An instance of the model object with the primary key data.

GetModelByIdentity

Gets a domain model object of dataModelType looking for it's identity property.

Signature:
public IDataModel GetModelByIdentity(dataModelType, model)
Returns

An initialized data model object.

Parameters
Name Type Summary
dataModelType Type The Type of the domain model object to retrieve.
model IDataModel An IDataModel holding the identity to look for.

GetModelByIdentity

Gets a model object of type looking for the identity field in the underlying table.

Signature:
public GetModelByIdentity<T>(model)
Returns

An initialized data model object.

Parameters
Name Type Summary
model T An instance of the model object with the identity data.

GetModelByIdentityAsync

Gets a domain model object of dataModelType looking for it's identity property.

Signature:
public Task<IDataModel> GetModelByIdentityAsync(dataModelType, model)
Returns

An initialized data model object.

Parameters
Name Type Summary
dataModelType Type The Type of the domain model object to retrieve.
model IDataModel An IDataModel holding the identity to look for.

GetModelByIdentityAsync

Gets a model object of type T looking for the identity field in the underlying table.

Signature:
public Task GetModelByIdentityAsync<T>(model)
Returns

An initialized data model object.

Parameters
Name Type Summary
model T An instance of the model object with the identity data.

Insert

Inserts a record into the underlaying data source.

Signature:
public Int32 Insert(model)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to insert.

InsertAsync

Inserts a record into the underlaying data source.

Signature:
public Task<Int32> InsertAsync(model)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to insert.

Update

Updates a record in the underlaying data source.

Signature:
public Int32 Update(model, timestampKind, expectedTimestamp)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to update.
timestampKind TimestampKind Kind of timestamp to apply on the WHERE clause.
expectedTimestamp DateTime Timestamp that is expected to be on the database.

UpdateAsync

Updates a record in the underlaying data source.

Signature:
public Task<Int32> UpdateAsync(model, timestampKind, expectedTimestamp)
Returns

Amount of records affected.

Parameters
Name Type Summary
model IDataModel The object to update.
timestampKind TimestampKind Kind of timestamp to apply on the WHERE clause.
expectedTimestamp DateTime Timestamp that is expected to be on the database.