Class DatabaseModelRecordDataExtensions
Extension methods to make it easy to fetch DatabaseModelRecordData objects from the database,
using the TargetedSelect infrastructure
Inheritance
DatabaseModelRecordDataExtensions
Assembly: SoDataBase.dll
Syntax
public static class DatabaseModelRecordDataExtensions
Methods
FromRecord(TargetedDataRecord<DatabaseModelTableInfo>)
Declaration
public static DatabaseModelRecordData FromRecord(this TargetedDataRecord<DatabaseModelTableInfo> 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 { DatabaseModelItem = r.FromRecord(), /* fetch other fields here */ });
FromSelect(TargetedSelect<DatabaseModelTableInfo>)
From a TargetedSelect<DatabaseModelTableInfo>, execute it and return an IEnumerable<DatabaseModelRecordData> with the results
Declaration
public static IEnumerable<DatabaseModelRecordData> FromSelect(this TargetedSelect<DatabaseModelTableInfo> select)
Parameters
Returns
Examples
var s = S.NewSelect<DataRightTableInfo>( /* add meaningful restrictions here, or later */ );
var result = s.FromSelect();
FromSelectAsync(TargetedSelect<DatabaseModelTableInfo>, CancellationToken)
From a TargetedSelect<DatabaseModelTableInfo>, execute it and return an IEnumerable<DatabaseModelRecordData> with the results
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static IAsyncEnumerable<DatabaseModelRecordData> FromSelectAsync(this TargetedSelect<DatabaseModelTableInfo> select, CancellationToken cancellationToken = default)
Parameters
Returns
Examples
var s = S.NewSelect<DataRightTableInfo>( /* add meaningful restrictions here, or later */ );
var result = s.FromSelect();
ToInsertAsync(DatabaseModelRecordData, CancellationToken)
Extension methods to make it easy to fetch DatabaseModelRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static Task<Insert> ToInsertAsync(this DatabaseModelRecordData record, CancellationToken cancellationToken = default)
Parameters
Returns
ToInsertsAsync(IEnumerable<DatabaseModelRecordData>, CancellationToken)
Extension methods to make it easy to fetch DatabaseModelRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static IAsyncEnumerable<Insert> ToInsertsAsync(this IEnumerable<DatabaseModelRecordData> records, CancellationToken cancellationToken = default)
Parameters
Returns
ToRecordData(DatabaseModelRow)
Extension methods to make it easy to fetch DatabaseModelRecordData objects from the database,
using the TargetedSelect infrastructure
Declaration
public static DatabaseModelRecordData ToRecordData(this DatabaseModelRow row)
Parameters
Returns