Iciclecreek.OData.Linq
1.0.0
dotnet add package Iciclecreek.OData.Linq --version 1.0.0
NuGet\Install-Package Iciclecreek.OData.Linq -Version 1.0.0
<PackageReference Include="Iciclecreek.OData.Linq" Version="1.0.0" />
<PackageVersion Include="Iciclecreek.OData.Linq" Version="1.0.0" />
<PackageReference Include="Iciclecreek.OData.Linq" />
paket add Iciclecreek.OData.Linq --version 1.0.0
#r "nuget: Iciclecreek.OData.Linq, 1.0.0"
#:package Iciclecreek.OData.Linq@1.0.0
#addin nuget:?package=Iciclecreek.OData.Linq&version=1.0.0
#tool nuget:?package=Iciclecreek.OData.Linq&version=1.0.0
![]()
Iciclecreek.OData.Linq
Lightweight library which applies OData query strings ($filter, $orderby, $select, $top, $skip) to any IQueryable<T>.
Overview
Most OData libraries pull in the full Microsoft OData stack — EDM model builders, ASP.NET Core middleware, service containers, and megabytes of transitive dependencies — just to parse a filter string. Iciclecreek.OData.Linq takes a different approach: a lightweight, hand-rolled parser with zero external dependencies that converts OData query strings directly into LINQ expressions.
This means it works with any IQueryable<T> provider — Entity Framework, in-memory collections,
Lucene.Net.Linq, or any other LINQ-compatible data source — without requiring EDM model definitions,
OData controllers, or ASP.NET middleware.
Supported OData features
| Feature | Example |
|---|---|
| Comparison operators | eq, ne, gt, ge, lt, le |
| Logical operators | and, or, not |
| Grouping | Parentheses () for precedence override |
in operator |
Name in ('Alice', 'Bob', 'Charlie') |
| String functions | contains, startswith, endswith, tolower, toupper, trim, length, indexof, substring, concat |
| Literal types | Strings, integers, decimals, booleans, null, DateTimeOffset, Guid |
$orderby |
Single or multiple properties, asc/desc |
$select |
Comma-separated property projection |
$top / $skip |
Result paging |
Install
dotnet add package Iciclecreek.OData.Linq
Usage
Add the namespace:
using Iciclecreek.OData.Linq;
Basic filtering
var results = people.AsQueryable()
.OData()
.Filter("Name eq 'Alice' and Age gt 21")
.ToQueryable()
.ToList();
Ordering
var results = people.AsQueryable()
.OData()
.OrderBy("Name desc, Age asc")
.ToQueryable()
.ToList();
Projection
Select returns IQueryable<T> with only the named properties populated (others get their default values):
var results = people.AsQueryable()
.OData()
.Select("Name, Age")
.ToQueryable()
.ToList();
// Each result has Name and Age set; all other properties are defaults
Paging
var results = people.AsQueryable()
.OData()
.Skip(10)
.Top(5)
.ToQueryable()
.ToList();
Full pipeline
All operations can be chained together. They are applied in order: Filter, OrderBy, Skip, Top, Select.
var results = people.AsQueryable()
.OData()
.Filter("IsActive eq true and Salary gt 50000")
.OrderBy("Salary desc")
.Skip(10)
.Top(5)
.Select("Name, Salary")
.ToQueryable()
.ToList();
String functions
// Contains
.Filter("contains(Name, 'smith')")
// Starts with / ends with
.Filter("startswith(Email, 'admin')")
.Filter("endswith(Email, '.com')")
// Case-insensitive comparison
.Filter("tolower(Name) eq 'alice'")
// String length
.Filter("length(Name) gt 10")
// Substring
.Filter("substring(Name, 0, 3) eq 'Ali'")
// Concatenation
.Filter("concat(FirstName, LastName) eq 'AliceSmith'")
The in operator
.Filter("Status in ('Active', 'Pending', 'Review')")
.Filter("Age in (25, 30, 35)")
Null handling
.Filter("Email eq null")
.Filter("Email ne null")
DateTimeOffset and Guid literals
.Filter("CreatedAt gt 2024-01-01T00:00:00Z")
.Filter("Id eq guid'12345678-1234-1234-1234-123456789012'")
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- 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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 125 | 5/2/2026 |