FastCrud.Core 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package FastCrud.Core --version 0.2.1
                    
NuGet\Install-Package FastCrud.Core -Version 0.2.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="FastCrud.Core" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FastCrud.Core" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="FastCrud.Core" />
                    
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 FastCrud.Core --version 0.2.1
                    
#r "nuget: FastCrud.Core, 0.2.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 FastCrud.Core@0.2.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=FastCrud.Core&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=FastCrud.Core&version=0.2.1
                    
Install as a Cake Tool

🚀 FastCrud — Minimal API CRUD Generator for .NET 9

FastCrud is a lightweight, flexible CRUD API generator for .NET 9.
It combines Minimal APIs + EF Core + DTOs + FluentValidation + Gridify + Auto-Swagger to let you bootstrap production-ready endpoints with minimal effort.


📦 Install NuGet packages

Add the required FastCrud packages (version 0.2.1):

dotnet add package FastCrud.Abstractions -v 0.2.1
dotnet add package FastCrud.Core -v 0.2.1
dotnet add package FastCrud.Mapping.Mapster -v 0.2.1
dotnet add package FastCrud.PersistenceEfCore -v 0.2.1
dotnet add package FastCrud.Query.Gridify -v 0.2.1
dotnet add package FastCrud.Validation.FluentValidation -v 0.2.1
dotnet add package FastCrud.Web.MinimalApi -v 0.2.1

⚙️ Configure Program.cs

Register FastCrud services:

builder.Services.AddFastCrudCore();
builder.Services.UseMapster();
builder.Services.UseGridifyQueryEngine();
builder.Services.UseFluentValidationAdapter();

Register EF repositories per entity:

builder.Services.AddEfRepository<Customer, Guid, AppDbContext>();
builder.Services.AddEfRepository<Order, Guid, AppDbContext>();

🌐 Map CRUD Endpoints

Define CRUD endpoints for each entity + DTO set:

app.MapFastCrud<Customer, Guid, CustomerCreateDto, CustomerUpdateDto, CustomerReadDto>(
    "/api/customers",
    nameof(Customer),
    "v1"
);

app.MapFastCrud<Order, Guid, OrderCreateDto, OrderUpdateDto, OrderReadDto>(
    "/api/orders",
    nameof(Order),
    "v1",
    ~CrudOps.Delete // disable Delete
);
  • Each entity requires 3 DTOs: CreateDto, UpdateDto, and ReadDto.
  • By default, all CRUD operations are generated.
  • To restrict operations, use the CrudOps flag with bitwise operators.

✅ Validation

Add FluentValidation validators for your DTOs or entities:

public class CustomerValidator : AbstractValidator<Customer>
{
    public CustomerValidator()
    {
        RuleFor(x => x.FirstName).NotEmpty().WithMessage("First name is required.");
        RuleFor(x => x.LastName).NotEmpty();
        RuleFor(x => x.Email).NotEmpty().EmailAddress();
    }
}

Validation is applied automatically to requests.


🔍 Filtering & Sorting with Gridify

Enable advanced query options by writing a Gridify profile:

public sealed class CustomerGridifyProfile : IGridifyMapperProfile<Customer>
{
    public void Configure(GridifyMapper<Customer> m)
    {
        m.Configuration.CaseInsensitiveFiltering = true;

        m.GenerateMappings()
         .AddMap("name", c => c.FirstName + " " + c.LastName)
         .RemoveMap(nameof(Customer.CreatedUtc));
    }
}

This enables expressive queries like:

  • GET /api/customers?filter=name~"john"&sort=-CreatedUtc&page=1&pageSize=20

🎉 Done!

With just a few lines, you get:

  • Clean Minimal APIs
  • Automatic Swagger docs
  • DTO mapping (Mapster)
  • Validation (FluentValidation)
  • Filtering, sorting & paging (Gridify)
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.2.8 176 9/19/2025
0.2.7 258 9/17/2025
0.2.6 220 9/15/2025
0.2.5 154 9/9/2025
0.2.4 129 9/9/2025
0.2.3 126 9/9/2025
0.2.2 134 9/9/2025
0.2.1 145 9/7/2025
0.2.0 77 9/5/2025
0.1.0 77 9/5/2025