mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 03:18:47 +00:00
refactor: remove IEnumerable.ConcatOne
This commit is contained in:
parent
23dee3d2b8
commit
d8be858359
@ -31,6 +31,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- X10D: `DateTime.Age(DateTime)` and `DateTimeOffset.Age(DateTimeOffset)` parameter renamed from `asOf` to `referenceDate`.
|
||||
|
||||
### Removed
|
||||
|
||||
- X10D: Removed `IEnumerable<T>.ConcatOne` - this functionality already exists with `Append`.
|
||||
|
||||
## [3.2.0] - 2023-04-03
|
||||
|
||||
### Added
|
||||
|
@ -9,32 +9,6 @@ namespace X10D.Linq;
|
||||
/// </summary>
|
||||
public static class EnumerableExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Concatenates a single value to the end of a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">The source sequence.</param>
|
||||
/// <param name="value">The value to concatenate to the end of the source sequence.</param>
|
||||
/// <typeparam name="TSource">The type of the elements in <paramref name="source" />.</typeparam>
|
||||
/// <returns>
|
||||
/// An <see cref="IEnumerable{T}" /> that contains the concatenated elements of the input sequence, and the specified
|
||||
/// value.
|
||||
/// </returns>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
|
||||
public static IEnumerable<TSource> ConcatOne<TSource>(this IEnumerable<TSource> source, TSource value)
|
||||
{
|
||||
if (source is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(source));
|
||||
}
|
||||
|
||||
foreach (TSource item in source)
|
||||
{
|
||||
yield return item;
|
||||
}
|
||||
|
||||
yield return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters a sequence of values by omitting elements that match a specified value.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user