Table of Contents

Interface IEntityProvider

Namespace
JJMasterData.Commons.Data.Entity.Providers
Assembly
JJMasterData.Commons.dll

Provides functionality to work with entity metadata and manage the database schema associated with an entity. The interface defines methods for generating scripts for table creation, updates, and stored procedures, as well as commands for data manipulation.

public interface IEntityProvider

Properties

VariablePrefix

string VariablePrefix { get; }

Property Value

string

Methods

ColumnExistsAsync(string, string, Guid?, CancellationToken)

Task<bool> ColumnExistsAsync(string tableName, string columnName, Guid? connectionId = null, CancellationToken cancellationToken = default)

Parameters

tableName string
columnName string
connectionId Guid?
cancellationToken CancellationToken

Returns

Task<bool>

DropStoredProcedureAsync(string, Guid?)

Task DropStoredProcedureAsync(string procedureName, Guid? connectionId = null)

Parameters

procedureName string
connectionId Guid?

Returns

Task

GetAlterTableScript(Element, IEnumerable<ElementField>)

string? GetAlterTableScript(Element element, IEnumerable<ElementField> addedFields)

Parameters

element Element
addedFields IEnumerable<ElementField>

Returns

string

GetCreateTableScript(Element, List<RelationshipReference>?)

string GetCreateTableScript(Element element, List<RelationshipReference>? relationships = null)

Parameters

element Element
relationships List<RelationshipReference>

Returns

string

GetDeleteCommand(Element, Dictionary<string, object>)

DataAccessCommand GetDeleteCommand(Element element, Dictionary<string, object> primaryKeys)

Parameters

element Element
primaryKeys Dictionary<string, object>

Returns

DataAccessCommand

GetElementFromTableAsync(string, Guid?)

Task<Element> GetElementFromTableAsync(string tableName, Guid? connectionId = null)

Parameters

tableName string
connectionId Guid?

Returns

Task<Element>

GetElementFromTableAsync(string, string, Guid?)

Task<Element> GetElementFromTableAsync(string schemaName, string tableName, Guid? connectionId)

Parameters

schemaName string
tableName string
connectionId Guid?

Returns

Task<Element>

GetInsertCommand(Element, Dictionary<string, object?>)

DataAccessCommand GetInsertCommand(Element element, Dictionary<string, object?> values)

Parameters

element Element
values Dictionary<string, object>

Returns

DataAccessCommand

GetInsertOrReplaceCommand(Element, Dictionary<string, object?>)

DataAccessCommand GetInsertOrReplaceCommand(Element element, Dictionary<string, object?> values)

Parameters

element Element
values Dictionary<string, object>

Returns

DataAccessCommand

GetReadCommand(Element, EntityParameters, DataAccessParameter)

DataAccessCommand GetReadCommand(Element element, EntityParameters parameters, DataAccessParameter totalOfRecordsParameter)

Parameters

element Element
parameters EntityParameters
totalOfRecordsParameter DataAccessParameter

Returns

DataAccessCommand

GetReadProcedureScript(Element)

string? GetReadProcedureScript(Element element)

Parameters

element Element

Returns

string

GetStoredProcedureDefinitionAsync(string, Guid?)

Task<string?> GetStoredProcedureDefinitionAsync(string procedureName, Guid? connectionId = null)

Parameters

procedureName string
connectionId Guid?

Returns

Task<string>

GetStoredProcedureListAsync(Guid?)

Task<List<string>> GetStoredProcedureListAsync(Guid? connectionId = null)

Parameters

connectionId Guid?

Returns

Task<List<string>>

GetUpdateCommand(Element, Dictionary<string, object?>)

DataAccessCommand GetUpdateCommand(Element element, Dictionary<string, object?> values)

Parameters

element Element
values Dictionary<string, object>

Returns

DataAccessCommand

GetWriteProcedureScript(Element)

string? GetWriteProcedureScript(Element element)

Parameters

element Element

Returns

string

TableExists(string, Guid?)

bool TableExists(string tableName, Guid? connectionId = null)

Parameters

tableName string
connectionId Guid?

Returns

bool

TableExistsAsync(string, Guid?, CancellationToken)

Task<bool> TableExistsAsync(string tableName, Guid? connectionId = null, CancellationToken cancellationToken = default)

Parameters

tableName string
connectionId Guid?
cancellationToken CancellationToken

Returns

Task<bool>

TableExistsAsync(string, string, Guid?, CancellationToken)

Task<bool> TableExistsAsync(string schema, string tableName, Guid? connectionId = null, CancellationToken cancellationToken = default)

Parameters

schema string
tableName string
connectionId Guid?
cancellationToken CancellationToken

Returns

Task<bool>