MapCrud
Instant CRUD endpoints for ASP.NET Core Minimal APIs with a single method call.
// Five CRUD endpoints in one line
app.MapCrud<Product>("products");
Why MapCrud?
- Zero boilerplate: Skip the repetitive controller actions and repository methods.
- Convention over configuration: Sensible defaults that work out of the box.
- Fully customizable: Override DTOs, key types, operations, and response shaping per entity.
- Production-grade features: Soft delete, FluentValidation, OpenAPI/Swagger, EF Core and InMemory backends.
- Multi-target: Supports net8.0, net9.0, and net10.0.
v1 Feature Set
| Feature | Description |
|---|---|
| Generic Keys | Guid, int, long, string — auto-discovered or explicit |
| DTO Mapping | Separate request/response DTOs with ReflectionMapper or custom IMapCrudMapper<,> |
| Nested property mapping | [MapFrom] attribute, 2-level convention flattening, .MapProperty() fluent API |
| Operation Configuration | DisableDelete(), OnlyGet(), OnlyPost(), and more |
| Filtering | Equality filter on any public property via query string |
| Sorting | Multi-field sort with ?sortby=field,-field |
| Pagination | ?page= and ?pagesize= with PagedResponse<T> |
| Response Wrapping | Envelope and pagination wrappers, global or per-entity |
| Soft Delete | ISoftDeletable — logical delete with ?includeDeleted=true |
| Mapperly Integration | Source-generated mappers via MapCrud.Mapperly |
| FluentValidation | Auto-wires IValidator<T> on POST/PUT |
| OpenAPI | Auto-generated query parameter docs for all filter properties |
Get Started{.button .is-primary .is-large} View on GitHub{.button .is-secondary .is-large}