Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,4 @@ docfx_project/obj/
docs/*
!docs/.gitkeep
!docs/RELEASE-WORKFLOW-SETUP.md
.nuget/
13 changes: 7 additions & 6 deletions src/Wolfgang.Etl.Abstractions/ExtractorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class ExtractorBase<TSource, TProgress>
/// <summary>
/// The number of milliseconds between progress updates.
/// </summary>
/// <exception cref="ArgumentException">Value cannot be less than 1</exception>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 1</exception>
public int ReportingInterval
{
get => _reportingInterval;
Expand All @@ -50,7 +50,7 @@ public int ReportingInterval
/// It is the responsibility of the derived class to keep this value up to date as the
/// base class will have no way of knowing the correct value
/// </remarks>

/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
[Range(0, int.MaxValue, ErrorMessage = "Current item count cannot be less than 0.")]
public int CurrentItemCount
{
Expand All @@ -70,6 +70,7 @@ protected set
/// <summary>
/// Gets the current number of records skipped
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
public int CurrentSkippedItemCount
{
Comment on lines +73 to 75
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CurrentSkippedItemCount's setter validates the input but never assigns the value to _currentSkippedItemCount, making the setter a no-op for derived classes. Assign _currentSkippedItemCount = value after the range check (consistent with CurrentItemCount).

Copilot uses AI. Check for mistakes.
get => _currentSkippedItemCount;
Expand All @@ -92,7 +93,7 @@ protected set
/// This is useful for partially extracting data from a source, especially when the source is large
/// or infinite or during development.
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 0</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 0</exception>
/// <example>
/// <code>
/// var count = 0;
Expand Down Expand Up @@ -136,7 +137,7 @@ public int MaximumItemCount
/// This is useful for partially extracting data from a source during development, or to skip
/// items that were already processed or are not relevant for the current extraction.
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 0</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 0</exception>
/// <example>
/// <code>
/// using (var reader = new StreamReader(filePath))
Expand Down Expand Up @@ -231,7 +232,7 @@ public virtual IAsyncEnumerable<TSource> ExtractAsync(IProgress<TProgress> progr
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(ReportingInterval)
);
Expand Down Expand Up @@ -265,7 +266,7 @@ public virtual IAsyncEnumerable<TSource> ExtractAsync(IProgress<TProgress> progr
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,

TimeSpan.FromMilliseconds(ReportingInterval)
Expand Down
19 changes: 10 additions & 9 deletions src/Wolfgang.Etl.Abstractions/LoaderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract class LoaderBase<TDestination, TProgress>
/// <summary>
/// The number of milliseconds between progress updates.
/// </summary>
/// <exception cref="ArgumentException">Value cannot be less than 1</exception>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 1</exception>
public int ReportingInterval
{
get => _reportingInterval;
Expand All @@ -52,7 +52,7 @@ public int ReportingInterval
/// It is the responsibility of the derived class to keep this value up to date as the
/// base class will have no way of knowing the correct value
/// </remarks>

/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
[Range(0, int.MaxValue, ErrorMessage = "Current item count cannot be less than 0.")]
public int CurrentItemCount
{
Expand All @@ -72,6 +72,7 @@ protected set
/// <summary>
/// Gets the current number of records skipped
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
public int CurrentSkippedItemCount
{
Comment on lines +75 to 77
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CurrentSkippedItemCount's setter validates the input but never assigns the value to _currentSkippedItemCount, so derived classes can't set this property (it only changes via IncrementCurrentSkippedItemCount). Assign _currentSkippedItemCount = value after validation, matching CurrentItemCount's setter.

Copilot uses AI. Check for mistakes.
get => _currentSkippedItemCount;
Expand All @@ -94,7 +95,7 @@ protected set
/// This is useful for partially loading data from a source, especially when the source is large
/// or infinite or during development.
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 1</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 1</exception>
Comment thread
Chris-Wolfgang marked this conversation as resolved.
/// <example>
/// <code>
/// foreach (var item in items.Skip(SkipItemCount).Take(MaxItemCount))
Expand All @@ -109,9 +110,9 @@ public int MaximumItemCount
get => _maximumItemCount;
set
{
if (value < 0)
if (value < 1)
{
throw new ArgumentOutOfRangeException(nameof(value), "Maximum item count cannot be less than 0.");
throw new ArgumentOutOfRangeException(nameof(value), "Maximum item count cannot be less than 1.");
}
_maximumItemCount = value;
}
Expand All @@ -126,7 +127,7 @@ public int MaximumItemCount
/// <remarks>
/// This is useful for skipping the beginning of the list during testing or because it may already be loaded
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 0</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 0</exception>
/// <example>
/// <code>
/// foreach (var item in items.Skip(SkipItemCount).Take(MaxItemCount))
Expand Down Expand Up @@ -229,7 +230,7 @@ IProgress<TProgress> progress
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(ReportingInterval)
);
Expand Down Expand Up @@ -271,7 +272,7 @@ CancellationToken token
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(ReportingInterval)
);
Expand Down Expand Up @@ -336,4 +337,4 @@ protected void IncrementCurrentSkippedItemCount()
Interlocked.Increment(ref _currentSkippedItemCount);
}

}
}
21 changes: 12 additions & 9 deletions src/Wolfgang.Etl.Abstractions/TransformerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract class TransformerBase<TSource, TDestination, TProgress>
/// <summary>
/// The number of milliseconds between progress updates.
/// </summary>
/// <exception cref="ArgumentException">Value cannot be less than 1</exception>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 1</exception>
public int ReportingInterval
{
get => _reportingInterval;
Expand All @@ -51,7 +51,7 @@ public int ReportingInterval
/// It is the responsibility of the derived class to keep this value up to date as the
/// base class will have no way of knowing the correct value
/// </remarks>

/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
[Range(0, int.MaxValue, ErrorMessage = "Current item count cannot be less than 0.")]
public int CurrentItemCount
{
Expand All @@ -71,6 +71,7 @@ protected set
/// <summary>
/// Gets the current number of records skipped
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">Value cannot be less than 0</exception>
public int CurrentSkippedItemCount
{
Comment on lines +74 to 76
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CurrentSkippedItemCount's setter validates the input but never assigns the value to _currentSkippedItemCount (the setter body only throws on negative values). This makes the setter effectively a no-op for derived classes and is inconsistent with CurrentItemCount. Assign _currentSkippedItemCount = value after the range check.

Copilot uses AI. Check for mistakes.
get => _currentSkippedItemCount;
Expand All @@ -93,7 +94,7 @@ protected set
/// This is useful for transforming a subset of data, especially when the source is large
/// or infinite or during development.
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 1</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 1</exception>
/// <example>
/// <code>
Comment thread
Chris-Wolfgang marked this conversation as resolved.
/// foreach (var item in items.Skip(SkipItemCount).Take(MaxItemCount))
Expand All @@ -108,9 +109,9 @@ public int MaximumItemCount
get => _maximumItemCount;
set
{
if (value < 0)
if (value < 1)
{
throw new ArgumentOutOfRangeException(nameof(value), "Maximum item count cannot be less than 0.");
throw new ArgumentOutOfRangeException(nameof(value), "Maximum item count cannot be less than 1.");
}
_maximumItemCount = value;
}
Expand All @@ -126,7 +127,7 @@ public int MaximumItemCount
/// This is useful for transforming a subset of data, especially when the source is large
/// or infinite or during development.
/// </remarks>
/// <exception cref="ArgumentException">The specified value is less than 0</exception>
/// <exception cref="ArgumentOutOfRangeException">The specified value is less than 0</exception>
/// <example>
/// <code>
/// foreach (var item in items.Skip(SkipItemCount).Take(MaxItemCount))
Expand Down Expand Up @@ -159,6 +160,7 @@ public int SkipItemCount
/// IAsyncEnumerable&lt;T&gt;
/// The result may be an empty sequence if no data is available or if the transformation fails.
/// </returns>
/// <exception cref="ArgumentNullException">The value of items is null</exception>
public virtual IAsyncEnumerable<TDestination> TransformAsync
(
IAsyncEnumerable<TSource> items
Expand All @@ -184,6 +186,7 @@ IAsyncEnumerable<TSource> items
/// </returns>
/// <remarks>
/// </remarks>
/// <exception cref="ArgumentNullException">The value of items is null</exception>
public virtual IAsyncEnumerable<TDestination> TransformAsync
(
IAsyncEnumerable<TSource> items,
Expand Down Expand Up @@ -226,7 +229,7 @@ IProgress<TProgress> progress
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(ReportingInterval)
);
Expand Down Expand Up @@ -270,7 +273,7 @@ CancellationToken token
using var timer = new Timer
(
_ => progress.Report(CreateProgressReport()),
null,
state: null,
TimeSpan.Zero,
TimeSpan.FromMilliseconds(ReportingInterval)
);
Expand Down Expand Up @@ -335,4 +338,4 @@ protected void IncrementCurrentSkippedItemCount()
Interlocked.Increment(ref _currentSkippedItemCount);
}

}
}
Loading