Skip to main content

Lightweight library which applies OData query strings ($filter, $orderby, $select, $top, $skip) to any IQueryable<T>.

Total Downloads
116
116
Published
May 2, 2026
5mo ago

Get Started

dotnet add package Iciclecreek.OData.Linq --version 1.0.0
ProductVersions
.NET Standard
netstandard2.1

README

Build and TestNuGet

Logo

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'")

Downloads by Version

Not enough data for chart

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.