FruityFoundation/Base/Extensions/EnumerableExtensions.cs

7 lines
283 B
C#
Raw Normal View History

2022-09-23 21:07:42 -04:00
namespace FruityFoundation.Base.Extensions;
public static class EnumerableExtensions
{
public static IEnumerable<T> ConditionalConcat<T>(this IEnumerable<T> enumerable, bool isConditionValid, IEnumerable<T> second) =>
!isConditionValid ? enumerable : enumerable.Concat(second);
}