Class ForeignKeyRecordDataExtensions
Extension methods to make it easy to fetch ForeignKeyRecordData objects from the database,
using the TargetedSelect infrastructure
Inheritance
ForeignKeyRecordDataExtensions
Assembly: SoDataBase.dll
Syntax
public static class ForeignKeyRecordDataExtensions
Methods
FromRecord(TargetedDataRecord<ForeignKeyTableInfo>)
From a TargetedDataRecord<ForeignKeyTableInfo>, create and populate a ForeignKeyRecordData POCO object
Declaration
public static ForeignKeyRecordData FromRecord(this TargetedDataRecord<ForeignKeyTableInfo> record)
Parameters
Returns
Examples
var s = S.NewSelect<DataRightTableInfo>( /* add meaningful restrictions here, or later */ );
/* add joins, return fields etc. as you wish */
s.ReturnFields.Add(s.Table.All);
var result = s.Records().Select(r => new { ForeignKeyItem = r.FromRecord(), /* fetch other fields here */ });
FromSelect(TargetedSelect<ForeignKeyTableInfo>)
From a TargetedSelect<ForeignKeyTableInfo>, execute it and return an IEnumerable<ForeignKeyRecordData> with the results
Declaration
public static IEnumerable<ForeignKeyRecordData> FromSelect(this TargetedSelect<ForeignKeyTableInfo> select)
Parameters
Returns
Examples
var s = S.NewSelect<DataRightTableInfo>( /* add meaningful restrictions here, or later */ );
var result = s.FromSelect();
FromSelectAsync(TargetedSelect<ForeignKeyTableInfo>, CancellationToken)
From a TargetedSelect<ForeignKeyTableInfo>, execute it and return an IEnumerable<ForeignKeyRecordData> with the results
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static IAsyncEnumerable<ForeignKeyRecordData> FromSelectAsync(this TargetedSelect<ForeignKeyTableInfo> select, CancellationToken cancellationToken = default)
Parameters
Returns
Examples
var s = S.NewSelect<DataRightTableInfo>( /* add meaningful restrictions here, or later */ );
var result = s.FromSelect();
ToInsertAsync(ForeignKeyRecordData, CancellationToken)
Extension methods to make it easy to fetch ForeignKeyRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static Task<Insert> ToInsertAsync(this ForeignKeyRecordData record, CancellationToken cancellationToken = default)
Parameters
Returns
ToInsertsAsync(IEnumerable<ForeignKeyRecordData>, CancellationToken)
Extension methods to make it easy to fetch ForeignKeyRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static IAsyncEnumerable<Insert> ToInsertsAsync(this IEnumerable<ForeignKeyRecordData> records, CancellationToken cancellationToken = default)
Parameters
Returns
ToRecordData(ForeignKeyRow)
Extension methods to make it easy to fetch ForeignKeyRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static ForeignKeyRecordData ToRecordData(this ForeignKeyRow row)
Parameters
Returns