Enumerable Tools
Enumerable tools to help you manipulate with them!
Enumerable extensions can be found in the EnumerableExtensions
static class that is found under the Magico.Enumeration
namespace. You don't have to explicitly reference the class, because you can just place a dot after the IEnumerable
instance.
You can access the extensions in one of the forms:
Length()
Length()
This extension counts the elements inside this enumerable class instance, and it's adaptive to several enumerable types for performance, as in:
Arrays
Lists
Dictionaries
Collections
Non-generic
IEnumerable
instances
In case this extension encounters an unknown non-generic IEnumerable
instance, it'll attempt to generate a generic IEnumerable<object>
class prior to counting the elements.
GetElementFromIndex()
GetElementFromIndex()
Gets an element using the index number from the enumerable that is either generic or non-generic. It's adaptive to several enumerable types for performance, as in:
Arrays
Lists
Dictionaries
Collections
Non-generic
IEnumerable
instances
In case this extension encounters an unknown non-generic IEnumerable
instance, it'll attempt to generate a generic IEnumerable<object>
class prior to counting the elements.
Zip()
Zip()
This extension merges two generic IEnumerable
instances into one.
ToDictionarySafe()
ToDictionarySafe()
This extension converts the source enumerable instance of the source type to a dictionary that is of a selected key type and value type. This ensures safe conversion.
Last updated