Table of Contents

Interface IHasRelationship

Namespace
AbanoubNassem.Trinity.Components.Interfaces
Assembly
AbanoubNassem.Trinity.dll

Interface for columns that have a relationship to another table.

public interface IHasRelationship

Properties

ColumnName

Gets or sets the name of the column.

string ColumnName { get; protected set; }

Property Value

string

ForeignColumn

Gets or sets the name of the foreign column for the relationship.

string? ForeignColumn { get; protected set; }

Property Value

string

ForeignTable

Gets or sets the name of the foreign table for the relationship.

string? ForeignTable { get; protected set; }

Property Value

string

HasRelationshipByDefault

A boolean that indicates whether this column has a relationship by default.

bool HasRelationshipByDefault { get; }

Property Value

bool

RelationshipName

The name of the relationship.

string? RelationshipName { get; protected set; }

Property Value

string

Methods

GetAssociatesRelationshipQuery(QueryFactory, string?, int, string?)

A method that gets the associates relationship query using the specified queryFactory, value, offset, search string, and returns a list of the key-value pairs.

Task<List<KeyValuePair<string, string>>> GetAssociatesRelationshipQuery(QueryFactory queryFactory, string? value, int offset, string? search = null)

Parameters

queryFactory QueryFactory

The query factory used to create the query

value string

The value to search for, if any.

offset int

The offset to use

search string

The search string to use

Returns

Task<List<KeyValuePair<string, string>>>

A list of key-value pairs

SelectRelationshipQuery(QueryFactory, List<IDictionary<string, object?>>, Sort?)

A method that selects the relationship query using the specified queryFactory and list of records, returns a list of the selected relationships.

Task<List<IDictionary<string, object?>>> SelectRelationshipQuery(QueryFactory queryFactory, List<IDictionary<string, object?>> records, Sort? sort = null)

Parameters

queryFactory QueryFactory

The query factory used to create the query

records List<IDictionary<string, object>>

The list of records to select from

sort Sort

The sorting object

Returns

Task<List<IDictionary<string, object>>>

A list of selected relationships