Indexerable 0.0.2
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 2.0
This package targets .NET Core 2.0. The package is compatible with this framework or higher.
.NET Standard 1.0
This package targets .NET Standard 1.0. The package is compatible with this framework or higher.
.NET Framework 4.5
This package targets .NET Framework 4.5. The package is compatible with this framework or higher.
dotnet add package Indexerable --version 0.0.2
NuGet\Install-Package Indexerable -Version 0.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Indexerable" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Indexerable" Version="0.0.2" />
<PackageReference Include="Indexerable" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Indexerable --version 0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Indexerable, 0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Indexerable@0.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Indexerable&version=0.0.2
#tool nuget:?package=Indexerable&version=0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Indexerable
Indexerable provides LINQ-style operations for IReadOnlyList<T>. Its list-oriented operators let you compose queries while retaining indexed access, without first materializing each intermediate result.
Support Platform
- .NET Framework 4.5
- .NET Framework 4.7
- .NET Framework 4.7.1
- .NET Standard 1.0
- .NET Standard 1.2
- .NET Standard 2.0
- .NET Standard 2.1
- .NET Core 5.0
- .NET Core App 2.0
- .NET Core App 2.1
- .NET Core App 3.0
- .NET 6.0
- .NET 7.0
- .NET 8.0
- .NET 9.0
Install
dotnet add package Indexerable
Then import the extension-method namespace:
using System;
using System.Collections.Generic;
using Indexer.Linq;
Quick start
using Indexer.Linq;
IReadOnlyList<int> values = Indexerable.Range(1, 5);
IReadOnlyList<int> result = values
.Select((value, index) => value * (index + 1))
.Skip(1)
.Take(3);
Console.WriteLine(result.Count); // 3
Console.WriteLine(result[1]); // 9
Console.WriteLine(string.Join(", ", result)); // 4, 9, 16
Available operations
All extension methods operate on IReadOnlyList<T> unless noted.
| Category | Methods |
|---|---|
| Create sequences | Range, Repeat, Empty, InfiniteSequence |
| Adapt lists | AsReadOnlyList, ToReadOnlyList, Cast |
| Transform and combine | Select, Append, Prepend, Concat, Zip, Reverse, Index |
| Select a portion | Skip, SkipLast, Take, TakeLast |
| Search | IndexOf(value), IndexOf(predicate) |
| Copy elements | CopyTo |
ToReadOnlyList also has an overload for string, which exposes its characters as a read-only list. InfiniteSequence<T> is available on .NET 7 and later targets.
How queries behave
- Sequence-producing operations return
IReadOnlyList<T>, withCount, indexed access, andforeach. Search operations such asIndexOfreturn an index, whileCopyTocopies elements into an array. - Most operators return lightweight list views. Elements are generally computed when accessed or enumerated rather than materialized into a new collection. For example,
Selectinvokes its selector each time an item is accessed; projected values are not cached. - Views over an existing list retain that source rather than taking a snapshot, so changes to a mutable source may be visible through the view.
- Most operators require an
IReadOnlyList<T>. Convert anIList<T>withToReadOnlyListwhen needed; it wraps the source rather than copying it. InfiniteSequenceis unbounded. ApplyTakebefore enumerating it fully.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.0 is compatible. netstandard1.1 was computed. netstandard1.2 is compatible. netstandard1.3 was computed. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
| Universal Windows Platform | netcore50 is compatible. uap was computed. uap10.0 was computed. uap10.0.15138 is compatible. |
| Windows Phone | wp8 is compatible. wp81 was computed. wpa81 was computed. |
| Windows Store | netcore was computed. netcore45 was computed. netcore451 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCore 5.0
- No dependencies.
-
.NETCoreApp 2.0
- No dependencies.
-
.NETCoreApp 2.1
- No dependencies.
-
.NETCoreApp 3.0
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETFramework 4.7.1
- No dependencies.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 1.2
- NETStandard.Library (>= 1.6.1)
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
-
UAP 10.0.15138
- No dependencies.
-
WindowsPhone 8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.