Ooze.Typed.EntityFrameworkCore 1.0.81

dotnet add package Ooze.Typed.EntityFrameworkCore --version 1.0.81
                    
NuGet\Install-Package Ooze.Typed.EntityFrameworkCore -Version 1.0.81
                    
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="Ooze.Typed.EntityFrameworkCore" Version="1.0.81" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ooze.Typed.EntityFrameworkCore" Version="1.0.81" />
                    
Directory.Packages.props
<PackageReference Include="Ooze.Typed.EntityFrameworkCore" />
                    
Project file
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 Ooze.Typed.EntityFrameworkCore --version 1.0.81
                    
#r "nuget: Ooze.Typed.EntityFrameworkCore, 1.0.81"
                    
#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 Ooze.Typed.EntityFrameworkCore@1.0.81
                    
#: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=Ooze.Typed.EntityFrameworkCore&version=1.0.81
                    
Install as a Cake Addin
#tool nuget:?package=Ooze.Typed.EntityFrameworkCore&version=1.0.81
                    
Install as a Cake Tool

Ooze.Typed 🌳💧🔧

Nuget framework framework framework GitHub Repo stars Nuget

Ooze.Typed is a .NET library that simplifies data querying in your applications by providing a strongly-typed approach to filtering, sorting, and paging operations on IQueryable<T> sources. Key features of library are:

  • Strongly-typed filters/sorters
  • Pagination
  • Query language - Optional support for string-based query expressions
  • Async capabilities - Optional opt in async/await support

Table of Contents

Installation

You can find latest versions on nuget on this location.

Additional packages

Except base Ooze.Typed package there are few more that add additional filter extensions to the filter builder that you use in your provider implementations. These are listed below:

These packages provide additional provider specific EF extensions to the filter builder pipeline. There is another package which can be installed and it will provide query language filtration:

Documentation

In order to use Ooze you'll need to create a few things. Simple example will be shown in the subsections below.

Creating filters

First off, in order to be able to filter your IQueryable<T> queries, you will need an implementation of IFilterProvider interface, a filter type and queryable entity type. Example of this can be seen below:

public class MyClass 
{
    public int Id { get; set; }
}

public class MyClassFilters
{
    public int Id { get; set; }
}


public class MyClassFiltersProvider : IFilterProvider<MyClass, MyClassFilters>
{
    public IEnumerable<FilterDefinition<MyClass, MyClassFilters>> GetFilters()
    {
        return Filters.CreateFor<MyClass, MyClassFilters>()
            //add equality filter onto MyClass instance over Id property and use Id property from incoming filter instance in that operation
            .Equal(x => x.Id, filter => filter.Id)
            //...add other filters if needed
            .Build();
    }
}

Creating sorters

Additionally, if we need to support sorting of IQueryable<T> queries, we will need implementation of ISorterProvider which will look similar to the filter implementation. Example of sorter provider can be seen below:

public class MyClassSortersProvider : ISorterProvider<MyClass, MyClassSorters>
{
    public IEnumerable<SortDefinition<MyClass, MyClassSorters>> GetSorters()
    {
        return Sorters.CreateFor<MyClass, MyClassSorters>()
            //add sorting on Id property in provided direction from sorter instance
            .SortBy(x => x.Id, sort => sort.Id)
            .Build();
    }
}

Registering implementations

Next step would be to register your filter/sorter implementations in your service collection. Example of this can be seen below:

//Example for minimal apis
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOozeTyped()
    .Add<MyClassFiltersProvider>()
    .Add<MyClassSortersProvider>();

//Example for Startup class
public class Startup 
{
    ...
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddOozeTyped()
            .Add<MyClassFiltersProvider>()
            .Add<MyClassSortersProvider>();
    }
    ...
}

Applying filtering/sorting/paging

Last part of this would be to call IOperationResolver in your code and pass it the filtering/sorting/paging options that you want to apply to your IQueryable<T> instance. Example of this can be seen below:

//lets say you have a route which gets filters/sorters from request body
app.MapPost("/", (
    DatabaseContext db,
    IOperationResolver<MyEntity, MyEntityFilters, MyEntitySorters> resolver,
    Input model) =>
{
    IQueryable<MyEntity> query = db.Set<MyEntity>();

    query = resolver
        .WithQuery(query)
        .Filter(model.Filters)
        //you can also use .Sort(model.Sorters) or .Page(model.Paging) method, or if you don't want to sort or page or even filter something out, you can always remove the calls.
        .Apply();

    //query will now contain updated IQueryable<MyEntity> instance with applied filters that were passed in the request
    return query;
});

//example type holding different details needed for filters/sorters/paging
public record Input(MyEntityFilters Filters, MyEntitySorters Sorters, PagingOptions Paging);

And that is it. You can define from which place you want to map/bind filters, sorters, paging. If you have a POST/PUT endpoint you can map it from request body. In case of GET request you might get it from the request url. Or in case you got some service you might manually pass the filters down to IOperationResolver. You can use whatever suits you best here.

More information

In case you want to see more examples and a bit more detailed documentation about each of the components be sure to check out docs

Filter extensions

As previously mentioned additional packages contains some usefull extensions when working with specific "flavor" of EF. For example you might be using Sqlite or SqlServer or Postgres etc. For these situations you can install these specific packages which contain extensions methods for the specific flavor. More about what is supported on each of the packages can be seen below.

Ooze.Typed.EntityFrameworkCore

This packages depends on EF Core packages and exposes next extensions:

  • Like() - EF.Eunctions.Like

Ooze.Typed.EntityFrameworkCore.Sqlite

This packages depends on EF Core Sqlite package and package mentioned beforehand and exposes next extensions:

  • Glob() - EF.Functions.Glob

Ooze.Typed.EntityFrameworkCore.SqlServer

This package depends on EF Core SqlServer package and package mentioned beforehand and exposes next extensions:

  • IsDate() - EF.Functions.IsDate
  • IsNumeric() - EF.Functions.IsNumeric
  • Contains() - EF.Functions.Contains
  • IsDateDiffDay() - EF.Functions.DateDiffDay
  • IsDateDiffMonth() - EF.Functions.DateDiffMonth
  • IsDateDiffWeek() - EF.Functions.DateDiffWeek
  • IsDateDiffYear() - EF.Functions.DateDiffYear
  • IsDateDiffHour() - EF.Functions.DateDiffHour
  • IsDateDiffMinute() - EF.Functions.DateDiffMinute
  • IsDateDiffSecond() - EF.Functions.DateDiffSecond
  • IsDateDiffMilisecond() - EF.Functions.DateDiffMilisecond
  • IsDateDiffMicrosecond() - EF.Functions.DateDiffMicrosecond
  • IsDateDiffNanosecond() - EF.Functions.DateDiffNanosecond

Ooze.Typed.EntityFrameworkCore.Npgsql

This package depends on EF Core Npgsql package and package mentioned beforehand and exposes next extensions:

  • InsensitiveLike() - EF.Functions.ILike
  • SoundexEqual() - EF.Functions.FuzzyStringMatchSoundex

Ooze.Typed.EntityFrameworkCore.MySql

This package depends on EF Core MySql (Pomelo) package and package mentioned beforehand and exposes next extensions:

  • IsDateDiffDay() - EF.Functions.DateDiffDay
  • IsDateDiffMonth() - EF.Functions.DateDiffMonth
  • IsDateDiffYear() - EF.Functions.DateDiffYear
  • IsDateDiffHour() - EF.Functions.DateDiffHour
  • IsDateDiffMinute() - EF.Functions.DateDiffMinute
  • IsDateDiffSecond() - EF.Functions.DateDiffSecond
  • IsDateDiffMicrosecond() - EF.Functions.DateDiffMicrosecond
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Ooze.Typed.EntityFrameworkCore:

Package Downloads
Ooze.Typed.EntityFrameworkCore.SqlServer

This package provides simple mechanism for applying filters, sorters, paging to your IQueryable queries. Contains additional extensions for Sql Server.

Ooze.Typed.EntityFrameworkCore.Sqlite

This package provides simple mechanism for applying filters, sorters, paging to your IQueryable queries. Contains additional extensions for Sqlite.

Ooze.Typed.EntityFrameworkCore.Npgsql

This package provides simple mechanism for applying filters, sorters, paging to your IQueryable queries. Contains additional extensions for PostgreSQL.

Ooze.Typed.EntityFrameworkCore.MySql

This package provides simple mechanism for applying filters, sorters, paging to your IQueryable queries. Contains additional extensions for MySql/MariaDB.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.81 385 11/12/2025
1.0.79 370 5/1/2025
1.0.78 1,038 12/20/2024
1.0.77 255 11/17/2024
1.0.75 381 9/1/2024
1.0.74 355 4/8/2024
1.0.72 436 12/29/2023
1.0.71 354 11/15/2023
1.0.70 437 9/9/2023
1.0.68 419 8/3/2023
1.0.67 362 7/29/2023
1.0.65 355 7/28/2023
1.0.64 373 7/25/2023
1.0.63 367 7/23/2023
1.0.62 349 7/23/2023
1.0.61 390 7/21/2023
1.0.58 382 7/19/2023
1.0.53 358 5/28/2023
1.0.49 349 5/24/2023
1.0.48 324 5/23/2023
Loading failed