Skip to content

Commit ba040dd

Browse files
author
Oren (electricessence)
committed
Updated ISourceBlock<T> to IReceivableSourceBlock<T>
1 parent bfda8c6 commit ba040dd

6 files changed

Lines changed: 22 additions & 22 deletions

Documentation.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ExpressiveCommandBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ public void ToTargetBlock<T>(ITargetBlock<T> target, Func<IDataRecord, T> transf
776776
/// If set to true, the command runs synchronously and all data is acquired before the method returns.
777777
/// If set to false (default) the data is received asynchronously (deferred: data will be subsequently posted) and the source block (transform) can be completed early.</param>
778778
/// <returns>The buffer block that will contain the results.</returns>
779-
public ISourceBlock<T> AsSourceBlock<T>(
779+
public IReceivableSourceBlock<T> AsSourceBlock<T>(
780780
Func<IDataRecord, T> transform,
781781
bool synchronousExecution = false)
782782
{
@@ -805,7 +805,7 @@ void I()
805805
/// If set to false (default) the data is received asynchronously (data will be subsequently posted) and the source block (transform) can be completed early.</param>
806806
/// <param name="options">The optional ExecutionDataflowBlockOptions to use with the source.</param>
807807
/// <returns>A transform block that is receiving the results.</returns>
808-
public ISourceBlock<T> AsSourceBlock<T>(
808+
public IReceivableSourceBlock<T> AsSourceBlock<T>(
809809
IEnumerable<(string Field, string Column)> fieldMappingOverrides,
810810
bool synchronousExecution = false,
811811
ExecutionDataflowBlockOptions options = null)
@@ -844,7 +844,7 @@ void I() => ExecuteReader(reader =>
844844
/// If set to false (default) the data is received asynchronously (data will be subsequently posted) and the source block (transform) can be completed early.</param>
845845
/// <param name="options">The optional ExecutionDataflowBlockOptions to use with the source.</param>
846846
/// <returns>A transform block that is receiving the results.</returns>
847-
public ISourceBlock<T> AsSourceBlock<T>(
847+
public IReceivableSourceBlock<T> AsSourceBlock<T>(
848848
IEnumerable<KeyValuePair<string, string>> fieldMappingOverrides,
849849
bool synchronousExecution = false,
850850
ExecutionDataflowBlockOptions options = null)
@@ -857,7 +857,7 @@ public ISourceBlock<T> AsSourceBlock<T>(
857857
/// <typeparam name="T">The model type to map the values to (using reflection).</typeparam>
858858
/// <param name="fieldMappingOverrides">An override map of field names to column names where the keys are the property names, and values are the column names.</param>
859859
/// <returns>A transform block that is receiving the results.</returns>
860-
public ISourceBlock<T> AsSourceBlock<T>(params (string Field, string Column)[] fieldMappingOverrides)
860+
public IReceivableSourceBlock<T> AsSourceBlock<T>(params (string Field, string Column)[] fieldMappingOverrides)
861861
where T : new()
862862
=> AsSourceBlock<T>(fieldMappingOverrides as IEnumerable<(string Field, string Column)>);
863863

ExpressiveDbCommandBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public Task ToTargetBlockAsync<T>(ITargetBlock<T> target, Func<IDataRecord, T> t
416416
/// <param name="transform">The transform function to process each IDataRecord.</param>
417417
/// <param name="options">The optional DataflowBlockOptions to use with the source.</param>
418418
/// <returns>A buffer block that is receiving the results.</returns>
419-
public ISourceBlock<T> AsSourceBlockAsync<T>(
419+
public IReceivableSourceBlock<T> AsSourceBlockAsync<T>(
420420
Func<IDataRecord, T> transform,
421421
DataflowBlockOptions options = null)
422422
{
@@ -441,7 +441,7 @@ public ISourceBlock<T> AsSourceBlockAsync<T>(
441441
/// <param name="fieldMappingOverrides">An override map of field names to column names where the keys are the property names, and values are the column names.</param>
442442
/// <param name="options">The optional ExecutionDataflowBlockOptions to use with the source.</param>
443443
/// <returns>A transform block that is receiving the results.</returns>
444-
public ISourceBlock<T> AsSourceBlockAsync<T>(
444+
public IReceivableSourceBlock<T> AsSourceBlockAsync<T>(
445445
IEnumerable<KeyValuePair<string, string>> fieldMappingOverrides,
446446
ExecutionDataflowBlockOptions options = null)
447447
where T : new()
@@ -453,7 +453,7 @@ public ISourceBlock<T> AsSourceBlockAsync<T>(
453453
/// <typeparam name="T">The model type to map the values to (using reflection).</typeparam>
454454
/// <param name="fieldMappingOverrides">An override map of field names to column names where the keys are the property names, and values are the column names.</param>
455455
/// <returns>A transform block that is receiving the results.</returns>
456-
public ISourceBlock<T> AsSourceBlockAsync<T>(params (string Field, string Column)[] fieldMappingOverrides)
456+
public IReceivableSourceBlock<T> AsSourceBlockAsync<T>(params (string Field, string Column)[] fieldMappingOverrides)
457457
where T : new()
458458
=> AsSourceBlockAsync<T>(fieldMappingOverrides as IEnumerable<(string Field, string Column)>);
459459

@@ -464,7 +464,7 @@ public ISourceBlock<T> AsSourceBlockAsync<T>(params (string Field, string Column
464464
/// <param name="options">The optional ExecutionDataflowBlockOptions to use with the source.</param>
465465
/// <param name="fieldMappingOverrides">An override map of field names to column names where the keys are the property names, and values are the column names.</param>
466466
/// <returns>A transform block that is receiving the results.</returns>
467-
public ISourceBlock<T> AsSourceBlockAsync<T>(
467+
public IReceivableSourceBlock<T> AsSourceBlockAsync<T>(
468468
ExecutionDataflowBlockOptions options,
469469
params (string Field, string Column)[] fieldMappingOverrides)
470470
where T : new()
@@ -508,7 +508,7 @@ public async Task<List<T>> ToListAsync<T>(Func<IDataRecord, T> transform, Comman
508508
/// <param name="fieldMappingOverrides">An override map of field names to column names where the keys are the property names, and values are the column names.</param>
509509
/// <param name="options"></param>
510510
/// <returns>A transform block that is receiving the results.</returns>
511-
public ISourceBlock<T> AsSourceBlockAsync<T>(
511+
public IReceivableSourceBlock<T> AsSourceBlockAsync<T>(
512512
IEnumerable<(string Field, string Column)> fieldMappingOverrides,
513513
ExecutionDataflowBlockOptions options = null)
514514
where T : new()

Open.Database.Extensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Description>Useful set of utilities and abstractions for simplifying modern data-access operations and ensuring DI compatibility.</Description>
1212
<RepositoryUrl>https://github.com/electricessence/Open.Database.Extensions</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
14-
<Version>5.13.1</Version>
14+
<Version>5.13.2</Version>
1515
<AssemblyVersion>5.13.0.0</AssemblyVersion>
1616
<FileVersion>5.13.0.0</FileVersion>
1717
<PackageReleaseNotes>Cleanup and inspection fixes with added Dataflow options.

QueryResult.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static Task<IEnumerable<T>> DequeueAs<T>(this Task<QueryResult<Queue<obje
143143
/// </summary>
144144
/// <param name="source">The query result. Typically produced by a .Retrieve method.</param>
145145
/// <returns>An block that dequeues the results and returns a column mapped dictionary for each entry</returns>
146-
public static ISourceBlock<Dictionary<string, object>> AsMappedDictionaries(this QueryResult<ISourceBlock<object[]>> source)
146+
public static IReceivableSourceBlock<Dictionary<string, object>> AsMappedDictionaries(this QueryResult<IReceivableSourceBlock<object[]>> source)
147147
{
148148
var q = source.Result;
149149
var names = source.Names;
@@ -170,8 +170,8 @@ public static ISourceBlock<Dictionary<string, object>> AsMappedDictionaries(this
170170
/// <param name="fieldMappingOverrides">An optional override map of field names to column names where the keys are the property names, and values are the column names.</param>
171171
/// <param name="options">The ExecutionDataflowBlockOptions for transforming the data into the source block.</param>
172172
/// <returns>An block that dequeues the results and returns a column mapped dictionary for each entry</returns>
173-
public static ISourceBlock<T> To<T>(
174-
this QueryResult<ISourceBlock<object[]>> source,
173+
public static IReceivableSourceBlock<T> To<T>(
174+
this QueryResult<IReceivableSourceBlock<object[]>> source,
175175
IEnumerable<(string Field, string Column)> fieldMappingOverrides,
176176
ExecutionDataflowBlockOptions options = null)
177177
where T : new()
@@ -187,7 +187,7 @@ public static ISourceBlock<T> To<T>(
187187
/// <param name="source">The query result. Typically produced by a .Retrieve method.</param>
188188
/// <param name="fieldMappingOverrides">An optional override map of field names to column names where the keys are the property names, and values are the column names.</param>
189189
/// <returns>An block that dequeues the results and returns a column mapped dictionary for each entry</returns>
190-
public static ISourceBlock<T> To<T>(this QueryResult<ISourceBlock<object[]>> source, IEnumerable<KeyValuePair<string, string>> fieldMappingOverrides)
190+
public static IReceivableSourceBlock<T> To<T>(this QueryResult<IReceivableSourceBlock<object[]>> source, IEnumerable<KeyValuePair<string, string>> fieldMappingOverrides)
191191
where T : new()
192192
=> To<T>(source, fieldMappingOverrides?.Select(kvp => (kvp.Key, kvp.Value)));
193193

@@ -198,7 +198,7 @@ public static ISourceBlock<T> To<T>(this QueryResult<ISourceBlock<object[]>> sou
198198
/// <param name="source">The query result. Typically produced by a .Retrieve method.</param>
199199
/// <param name="fieldMappingOverrides">An optional override map of field names to column names where the keys are the property names, and values are the column names.</param>
200200
/// <returns>An block that dequeues the results and returns a column mapped dictionary for each entry</returns>
201-
public static ISourceBlock<T> To<T>(this QueryResult<ISourceBlock<object[]>> source, params (string Field, string Column)[] fieldMappingOverrides)
201+
public static IReceivableSourceBlock<T> To<T>(this QueryResult<IReceivableSourceBlock<object[]>> source, params (string Field, string Column)[] fieldMappingOverrides)
202202
where T : new()
203203
=> To<T>(source, fieldMappingOverrides as IEnumerable<(string Field, string Column)>);
204204

Transformer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public IEnumerable<T> AsDequeueingEnumerable(QueryResult<Queue<object[]>> result
111111
// By using the above routine, we guarantee as enumeration occurs, references are released (dequeued).
112112
}
113113

114-
public ISourceBlock<T> Results(
114+
public IReceivableSourceBlock<T> Results(
115115
out Action<QueryResult<IEnumerable<object[]>>> deferred,
116116
ExecutionDataflowBlockOptions options = null)
117117
{
@@ -129,8 +129,8 @@ public ISourceBlock<T> Results(
129129
return x;
130130
}
131131

132-
public ISourceBlock<T> Results(
133-
QueryResult<ISourceBlock<object[]>> source,
132+
public IReceivableSourceBlock<T> Results(
133+
QueryResult<IReceivableSourceBlock<object[]>> source,
134134
ExecutionDataflowBlockOptions options = null)
135135
{
136136
var processor = new Processor(this, source.Names);

0 commit comments

Comments
 (0)