Coree.NETStandard
  • API
Show / Hide Table of Contents
  • Coree.NETStandard.Abstractions.DependencySingleton
    • DependencySingleton<T>
    • IDependencySingleton
  • Coree.NETStandard.Abstractions.FluentBase
    • FluentBase
    • IFluentBase
  • Coree.NETStandard.Abstractions.InitializationService
    • InitializationDependentServices
    • InitializationService
  • Coree.NETStandard.Abstractions.ServiceFactory
    • ServiceFactory<T>
  • Coree.NETStandard.Abstractions.ServiceFactoryEx
    • ServiceFactoryEx<T>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X, Y, Z>
    • ServiceFactoryEx<T, K>
    • ServiceFactoryEx<T, K, R>
    • ServiceFactoryEx<T, K, R, S>
    • ServiceFactoryEx<T, K, R, S, U>
    • ServiceFactoryEx<T, K, R, S, U, V>
    • ServiceFactoryEx<T, K, R, S, U, V, W>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X>
    • ServiceFactoryEx<T, K, R, S, U, V, W, X, Y>
  • Coree.NETStandard.Classes.AsyncEventCollection
    • AsyncEventCollection<T>
    • AsyncEventCollection<T>.CustomEventDelegate
  • Coree.NETStandard.Classes.CommonDistinguishedNameBuilder
    • CommonDistinguishedNameBuilder
    • DistinguishedName
  • Coree.NETStandard.Classes.Criteria
    • CriteriaComparisonMethod
    • CriteriaEnumerableExtensions
    • CriteriaExpressionBuilder
    • CriteriaItem<TValue>
    • CriteriaItems
    • CriteriaOperator
    • CriteriaQueryableExtensions
  • Coree.NETStandard.Classes.HttpRequestService
    • ContentComposer
    • HttpRequestHeadersExtensions
    • HttpRequestService
    • HttpRequestServiceHandler
    • HttpRequestServiceUriExtensions
    • ServiceCollectionExtensions
    • TransactionRecord
  • Coree.NETStandard.Classes.Scheduler
    • Scheduler
    • Scheduler.TickerEventArgs
    • Scheduler.TickerEventDelegate
  • Coree.NETStandard.Classes.ThreadSafeCollection
    • ThreadSafeCollection<T>
  • Coree.NETStandard.Classes.ThreadSafeValue
    • ThreadSafeValue<T>
  • Coree.NETStandard.Classes.TimeOfDay
    • TimeOfDay
  • Coree.NETStandard.Extensions.Collections.Enumerable
    • CollectionsEnumerableExtensions
  • Coree.NETStandard.Extensions.Collections.List
    • CollectionsListExtensions
  • Coree.NETStandard.Extensions.Conversions.ByteArray
    • ConversionsByteArrayExtensions
  • Coree.NETStandard.Extensions.Conversions.HostApplicationBuilder
    • ConversionsHostApplicationBuilderExtensions
  • Coree.NETStandard.Extensions.Conversions.String
    • ConversionsStringExtensions
    • Encodings
  • Coree.NETStandard.Extensions.Conversions.Stringbuilder
    • ConversionsStringbuilderExtension
  • Coree.NETStandard.Extensions.Enums
    • EnumExtensions
  • Coree.NETStandard.Extensions.Http.HttpHeader
    • HttpHeadersExtensions
  • Coree.NETStandard.Extensions.Primitives.Bool
    • PrimitivesBoolExtensions
  • Coree.NETStandard.Extensions.Reflection.ServiceProvider
    • ReflectionServiceProviderExtensions
  • Coree.NETStandard.Extensions.ServiceCollection
    • ServiceCollectionExtensions
  • Coree.NETStandard.Extensions.Threading.CancellationToken
    • ThreadingCancellationTokenExtensions
  • Coree.NETStandard.Extensions.Utilities
    • DateTimeExtensions
  • Coree.NETStandard.Extensions.Validations.String
    • ValidationsStringExtensions
  • Coree.NETStandard.HostedServicesCollection
    • HostedServicesCollectionConfig<T>
    • IHostedServicesCollectionConfig<T>
    • ServiceCollectionExtensions
    • ServiceProviderExtensions
  • Coree.NETStandard.Serilog
    • ConditionalLevelSink
    • CustomTheme
    • LoggerSinkConfigurationExtensions
    • OutputTemplates
    • ServiceCollectionExtensions
    • SourceContextShortEnricher
  • Coree.NETStandard.Services.DebugManagement
    • DebugService
    • IDebugService
  • Coree.NETStandard.Services.DirectoryOperationsManagement
    • DirectoryOperationsService
    • IDirectoryOperationsService
  • Coree.NETStandard.Services.FileManagement
    • FileService
    • IFileService
  • Coree.NETStandard.Services.FileOperationsManagement
    • FileOperationsService
    • FileOperationsService.FileSystemEntry
    • FileOperationsService.FileSystemInformation
    • FileOperationsService.VerifiedCopyStatus
    • IFileOperationsService
  • Coree.NETStandard.Services.HashManagement
    • HashService
    • IHashService
  • Coree.NETStandard.Services.NetworkManagement
    • INetworkService
    • NetworkService
    • NetworkService.IpAdressInformation
    • NetworkService.NetworkInterfaceDetail
  • Coree.NETStandard.Services.ProcessManagement
    • IProcessService
    • ProcessRunExitCodeState
    • ProcessRunResult
    • ProcessService
  • Coree.NETStandard.Services.RuntimeInsightsManagement
    • IRuntimeInsightsService
    • RuntimeInsightsService
  • Coree.NETStandard.SpectreConsole
    • CommandAppExtensions
    • HostBuilderExtensions
    • ServiceCollectionExtensions
    • SpectreConsoleHostedService
    • SpectreConsoleHostedService.ExitCode
    • SpectreConsoleTypeRegistrar
    • SpectreConsoleTypeResolver
  • Coree.NETStandard.UnderConstruction
    • DbContextExtensions
    • HttpClientStatic
    • HttpClientStatic.HttpClientResponse
    • HttpClientStatic.XRate
    • HttpClientStatic.XRateGroup
    • HttpClientStatic.XRateItem
    • IScheduleProvider
    • IntervalScheduleProvider
    • LimitedHistory<T>
    • ScheduleCombiner
    • Scheduler
    • Scheduler.TickerEventArgs
    • Scheduler.TickerEventDelegate
    • Scheduler2
    • Scheduler2.TickerEventArgs
    • Scheduler2.TickerEventDelegate
    • Scheduler3
    • Scheduler3.TickerEventArgs
    • Scheduler3.TickerEventDelegate
    • SqlliteMemoryContext
    • SqlliteMemoryContext.UserDataDto
    • TimedEntry<T>
    • Timing
    • Timing.Ticker
    • Timing.Ticker.TickerEventArgs
    • Timing.TickerSync
    • WeekDayAtScheduleProvider
  • Coree.NETStandard.Utilities
    • EventSubscription
    • MainContext

Class CollectionsEnumerableExtensions

Provides extension methods for IEnumerable<T> to enhance and simplify operations on collections.

Inheritance
object
CollectionsEnumerableExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Coree.NETStandard.Extensions.Collections.Enumerable
Assembly: Coree.NETStandard.dll
Syntax
public static class CollectionsEnumerableExtensions
Remarks

This static class contains a collection of utility methods that extend the functionality of the IEnumerable<T> interface. These methods offer convenient ways to perform common operations on enumerable collections, such as filtering, transformation, and aggregation, with a focus on improving code readability and efficiency. This class is declared as partial to allow for easy extension and organization of its methods across multiple files, facilitating maintainability and scalability of the utility functions provided.

Methods

| Edit this page View Source

AppendRange<T>(IEnumerable<T>, IEnumerable<T>)

Appends a range of items to the end of an IEnumerable<T>.

Declaration
public static IEnumerable<T> AppendRange<T>(this IEnumerable<T> source, IEnumerable<T> items) where T : class
Parameters
Type Name Description
IEnumerable<T> source

The source collection to which the items will be appended.

IEnumerable<T> items

The collection of items to append to the source collection.

Returns
Type Description
IEnumerable<T>

An IEnumerable<T> that consists of the original elements followed by the added items.

Type Parameters
Name Description
T

The type of the elements in both the source and items collections. Must be a class.

Exceptions
Type Condition
ArgumentNullException

Thrown if either the source collection or the items collection is null.

| Edit this page View Source

ContainsOrdinalIgnoreCase(IEnumerable<string>, string)

Determines whether the sequence contains a specific value, using a case-insensitive ordinal comparison.

Declaration
public static bool ContainsOrdinalIgnoreCase(this IEnumerable<string> source, string value)
Parameters
Type Name Description
IEnumerable<string> source

The source enumerable.

string value

The string to locate in the sequence.

Returns
Type Description
bool

true if the source sequence contains an element that has the specified value; otherwise, false.

| Edit this page View Source

RemoveNullEntries<T>(IEnumerable<T?>)

Filters out null entries from an IEnumerable<T>.

Declaration
public static IEnumerable<T> RemoveNullEntries<T>(this IEnumerable<T?> enumerable) where T : class?
Parameters
Type Name Description
IEnumerable<T> enumerable

The enumerable collection to filter.

Returns
Type Description
IEnumerable<T>

An IEnumerable<T> without null elements.

Type Parameters
Name Description
T

The type of elements in the collection, constrained to reference types.

Remarks

This extension method iterates over each element in the given enumerable, returning only those elements that are not null. It is applicable to collections of reference types.

| Edit this page View Source

RemoveNullOrWhiteSpaceEntries(IEnumerable<string?>)

Filters out null, empty, and whitespace-only entries from an IEnumerable<T>.

Declaration
public static IEnumerable<string> RemoveNullOrWhiteSpaceEntries(this IEnumerable<string?> enumerable)
Parameters
Type Name Description
IEnumerable<string> enumerable

The enumerable collection of strings to filter.

Returns
Type Description
IEnumerable<string>

An IEnumerable<T> consisting of non-empty and non-whitespace strings.

Remarks

This extension method iterates over each element in the given enumerable, returning only those elements that are not null, not empty, and not made up solely of whitespace characters.

  • Edit this page
  • View Source
In this article
Back to top