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
ForeignColumn
Gets or sets the name of the foreign column for the relationship.
string? ForeignColumn { get; protected set; }
Property Value
ForeignTable
Gets or sets the name of the foreign table for the relationship.
string? ForeignTable { get; protected set; }
Property Value
HasRelationshipByDefault
A boolean that indicates whether this column has a relationship by default.
bool HasRelationshipByDefault { get; }
Property Value
RelationshipName
The name of the relationship.
string? RelationshipName { get; protected set; }
Property Value
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
QueryFactoryThe query factory used to create the query
value
stringThe value to search for, if any.
offset
intThe offset to use
search
stringThe 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
QueryFactoryThe query factory used to create the query
records
List<IDictionary<string, object>>The list of records to select from
sort
SortThe sorting object
Returns
- Task<List<IDictionary<string, object>>>
A list of selected relationships