FastSharp.Models
1.0.0-beta.6
See the version list below for details.
dotnet add package FastSharp.Models --version 1.0.0-beta.6
NuGet\Install-Package FastSharp.Models -Version 1.0.0-beta.6
<PackageReference Include="FastSharp.Models" Version="1.0.0-beta.6" />
<PackageVersion Include="FastSharp.Models" Version="1.0.0-beta.6" />
<PackageReference Include="FastSharp.Models" />
paket add FastSharp.Models --version 1.0.0-beta.6
#r "nuget: FastSharp.Models, 1.0.0-beta.6"
#:package FastSharp.Models@1.0.0-beta.6
#addin nuget:?package=FastSharp.Models&version=1.0.0-beta.6&prerelease
#tool nuget:?package=FastSharp.Models&version=1.0.0-beta.6&prerelease
FastSharp
FastSharp is a lightweight library 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>();
}
public class CheckProductStock : IEndpoint
{
public void Map(RouteGroupBuilder app)
{
app.MapGet("/{id}/stock", async ([FromRoute] int id) =>
{
return Results.Ok($"Checking stock for product {id}");
})
.WithTags("prueba");
}
}
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 | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FastSharp.Models:
| Package | Downloads |
|---|---|
|
FastSharp.Modules
FastSharp: Convention-over-configuration CRUDs and modular endpoints for .NET Minimal APIs. Build faster, keep it clean. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta.16 | 82 | 7/28/2026 |
| 1.0.0-beta.14 | 67 | 7/28/2026 |
| 1.0.0-beta.12 | 130 | 6/11/2026 |
| 1.0.0-beta.11 | 74 | 5/29/2026 |
| 1.0.0-beta.10 | 70 | 5/29/2026 |
| 1.0.0-beta.8 | 75 | 4/14/2026 |
| 1.0.0-beta.7 | 75 | 4/1/2026 |
| 1.0.0-beta.6 | 70 | 3/31/2026 |
| 1.0.0-beta.5 | 76 | 3/31/2026 |
| 1.0.0-beta.4 | 73 | 3/23/2026 |
| 1.0.0-beta.3 | 69 | 3/21/2026 |
| 1.0.0-beta.2 | 77 | 2/21/2026 |
| 1.0.0-alpha.4 | 83 | 2/12/2026 |
| 1.0.0-alpha.1 | 76 | 2/11/2026 |