Razory 2.1.1

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

Razory

Build & Test NuGet License: MIT

Framework-agnostic repository and query object abstractions for .NET 10. Provides the core contracts shared across all database providers.

What's included

  • EntityBase — base entity with Id (Guid), CreateDate, UpdateDate
  • IEntityConfiguration<T> — contract for mapping an entity to a table/collection name
  • IDatabaseConfiguration — contract for providing connection info and entity configurations
  • IRepository — CRUD + Upsert contract using Expression<Func<T, bool>>
  • IQueryObject<T> — fluent query builder
  • IQueryObjectResult<T> — agnostic query result (filter, sort, paginate, project)
  • IQueryObjectAggregateResult<T> — agnostic aggregate result (group, project)
  • QueryObjectFilterDefinition<T> — base class for typed, reusable filter definitions

Usage

Install a provider alongside this package:

Defining entities

public class Product : EntityBase
{
    public string Name { get; set; }
    public string Category { get; set; }
    public bool IsActive { get; set; }
}

Defining filter definitions

public class ProductFilter : QueryObjectFilterDefinition<Product>
{
    public ProductFilter ActiveOnly()
    {
        AddFilter(p => p.IsActive);
        return this;
    }

    public ProductFilter WithCategory(string category)
    {
        AddFilter(p => p.Category == category);
        return this;
    }
}

Using IRepository and IQueryObject<T>

public class ProductService(IRepository repository, IQueryObject<Product> query)
{
    public Task<Product> GetByIdAsync(Guid id) =>
        repository.GetAsync<Product>(id);

    public Task InsertAsync(Product product) =>
        repository.InsertAsync(product);

    public Task UpsertAsync(Product product) =>
        repository.UpsertAsync(p => p.Id == product.Id, product);

    public Task<IEnumerable<Product>> GetActiveByCategoryAsync(string category) =>
        query
            .FilterBy<ProductFilter>(f => f.ActiveOnly().WithCategory(category))
            .SortAscending(p => p.Name)
            .Query()
            .GetAllAsync();

    public Task<IEnumerable<Product>> GetPageAsync(int page, int size) =>
        query
            .FilterBy(p => p.IsActive)
            .Query()
            .Skip((page - 1) * size)
            .Limit(size)
            .GetAllAsync();
}

Repository

github.com/johnyricalde/Razory

Product Compatible and additional computed target framework versions.
.NET 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 (2)

Showing the top 2 NuGet packages that depend on Razory:

Package Downloads
Razory.EntityFramework

Entity Framework Core provider for Razory. Implements IRepository and IQueryObject using EF Core and IQueryable.

Razory.MongoDB

MongoDB provider for Razory. Implements IRepository and IQueryObject using the official MongoDB .NET Driver.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.1 132 3/28/2026
2.1.0 120 3/28/2026
2.0.1 116 3/26/2026
2.0.0 131 3/26/2026
1.4.3 89 5/27/2026
1.4.2 95 5/21/2026
1.4.1 90 5/21/2026
1.4.0 92 5/21/2026
1.3.1 109 2/27/2026
1.3.0 109 2/27/2026
1.2.10 120 1/26/2026
1.2.9 202 8/12/2025
1.2.8 192 8/12/2025
1.2.7 190 8/12/2025
1.2.6 194 8/12/2025
1.2.5 190 8/11/2025
1.2.4 185 8/11/2025
1.2.3 187 8/11/2025
1.2.2 190 8/11/2025
1.2.1 203 7/14/2025
Loading failed