FastSharp.Modules
1.0.0-beta.4
See the version list below for details.
dotnet add package FastSharp.Modules --version 1.0.0-beta.4
NuGet\Install-Package FastSharp.Modules -Version 1.0.0-beta.4
<PackageReference Include="FastSharp.Modules" Version="1.0.0-beta.4" />
<PackageVersion Include="FastSharp.Modules" Version="1.0.0-beta.4" />
<PackageReference Include="FastSharp.Modules" />
paket add FastSharp.Modules --version 1.0.0-beta.4
#r "nuget: FastSharp.Modules, 1.0.0-beta.4"
#:package FastSharp.Modules@1.0.0-beta.4
#addin nuget:?package=FastSharp.Modules&version=1.0.0-beta.4&prerelease
#tool nuget:?package=FastSharp.Modules&version=1.0.0-beta.4&prerelease
FastSharp
FastSharp is a lightweight metaframework for building APIs in C# and ASP.NET Core (Minimal APIs). Full CRUDs and custom endpoints, organized by domain modules, in a single line of code.
Why FastSharp?
In ASP.NET Core Minimal APIs, even a simple CRUD for one entity means writing the same boilerplate over and over. FastSharp eliminates that:
// This single line generates 6 REST endpoints backed by EF Core
AddCRUD<Product, int>("products");
No controllers. No repetition. Just modules organized by domain.
Installation
dotnet add package FastSharp.Modules
dotnet add package FastSharp.Models
FastSharp.Modulesis the core.FastSharp.Modelscontains only the model interfaces — add it to projects that don't need the full core.
Quick Start
The minimum setup requires 4 files. This example uses an in-memory database so you can run it immediately.
1. Install the dependencies
dotnet add package FastSharp.Modules
dotnet add package FastSharp.Models
dotnet add package Microsoft.EntityFrameworkCore.InMemory
2. Your model
// Models/Product.cs
using FastSharp.Models;
public class Product : IModel<int>
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
}
3. Your DbContext
// Data/AppDbContext.cs
using Microsoft.EntityFrameworkCore;
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
public DbSet<Product> Products => Set<Product>();
}
4. Your module
// Modules/Products/ProductsModule.cs
using FastSharp.Modules;
public class ProductsModule : Module<AppDbContext>
{
public ProductsModule()
{
ConfigureModule("api/", module => module.WithTags("Products"));
AddCRUD<Product, int>("products");
}
}
5. Program.cs
using FastSharp.Modules;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<AppDbContext>(opt =>
opt.UseInMemoryDatabase("fastsharp-demo"));
builder.Services.AddFastSharpEndpoints();
builder.Services.AddOpenApi();
var app = builder.Build();
app.MapFastSharpEndpoints();
app.MapOpenApi();
app.Run();
Run the project and open /openapi/v1.json — you'll see all 6 endpoints ready to use.
What does AddCRUD generate?
| Method | Route | Description |
|---|---|---|
GET |
/api/products/paged |
Paginated list |
GET |
/api/products |
Full list |
GET |
/api/products/{id} |
Get by ID |
POST |
/api/products |
Create |
PUT |
/api/products/{id} |
Update |
DELETE |
/api/products/{id} |
Delete |
Configuration
Disable specific endpoints
AddCRUD<Product, int>("products", crud =>
{
crud.DisableEndpoint(GenericEndpoint.GetList);
});
Use DTOs
AddCRUD<Product, int>("products", crud =>
{
crud.Update<ProductDto>();
// Or apply DTOs to all endpoints:
// crud.ConfigureAll<ProductDto>();
});
Add metadata for OpenAPI
AddCRUD<Product, int>("products", crud =>
{
crud.Get(endpoint =>
endpoint.WithDescription("Get a product by its unique identifier"));
});
Add custom endpoints to the same module
public ProductsModule()
{
ConfigureModule("api/", module => module.WithTags("Products"));
AddCRUD<Product, int>("products");
// Custom endpoints inherit the module's group configuration
Include<CheckProductStock>();
}
Architecture
FastSharp is built on Modular Slices — group your logic by domain, not by technical layers.
YourProject/
└── Modules/
├── Products/
│ ├── ProductsModule.cs
│ ├── CheckProductStock.cs
│ └── ProductDto.cs
└── Orders/
├── OrdersModule.cs
└── OrderDto.cs
Each module is a self-contained unit: its routes, its DTOs, its custom endpoints. FastSharp auto-discovers all modules in your assembly — no manual registration needed.
Requirements
- .NET 10 or higher
- Entity Framework Core
- A registered
DbContextin the dependency container - Models implementing
IModel<TId> - Modules inheriting from
Module<TDbContext>
Docs
License
MIT
| Product | Versions 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. |
-
net10.0
- FastSharp.Models (>= 1.0.0-beta.4)
- Mapster (>= 10.0.0 && < 11.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0 && < 11.0.0)
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-beta.16 | 79 | 7/28/2026 |
| 1.0.0-beta.12 | 124 | 6/11/2026 |
| 1.0.0-beta.11 | 72 | 5/29/2026 |
| 1.0.0-beta.8 | 73 | 4/14/2026 |
| 1.0.0-beta.7 | 74 | 4/1/2026 |
| 1.0.0-beta.6 | 69 | 3/31/2026 |
| 1.0.0-beta.5 | 66 | 3/31/2026 |
| 1.0.0-beta.4 | 68 | 3/23/2026 |
| 1.0.0-beta.3 | 69 | 3/21/2026 |
| 1.0.0-beta.2 | 79 | 2/21/2026 |
| 1.0.0-alpha.4 | 82 | 2/12/2026 |
| 1.0.0-alpha.1 | 81 | 2/11/2026 |