Regira Entities is a generic, extensible framework for managing data entities in .NET applications. It provides a standardized way to handle CRUD operations, filtering, sorting, and includes, while allowing customization through generic type parameters, interfaces and specialized helper services.
The core abstractions ship as Regira.Entities. The setup below additionally requires the DI, EF Core, and Web sibling packages:
<!-- Core abstractions and base types -->
<PackageReference Include="Regira.Entities" Version="6.*" />
<!-- Required for the sample below -->
<PackageReference Include="Regira.Entities.DependencyInjection" Version="6.*" />
<PackageReference Include="Regira.Entities.EFcore" Version="6.*" />
<PackageReference Include="Regira.Entities.Web" Version="6.*" />
Understanding the generic type system is crucial:
| Type | Required | Purpose | Default (when omitted) | Example |
|---|---|---|---|---|
| TEntity | ✓ | The entity class | - | Product |
| TKey | ○ | Primary key type | int |
Guid, int |
| TSearchObject | ○ | Advanced filtering | SearchObject |
ProductSearchObject |
| TSortBy | ○ | Sorting enum | EntitySortBy |
ProductSortBy |
| TInclude | ○ | Navigation properties enum | EntityIncludes |
ProductIncludes |
| TDto | ○ | Read/display model (details & lists) | TEntity |
ProductDto |
| TInputDto | ○ | Create/update model | TEntity |
ProductInputDto |
IEntityService is the central contract of this framework. Register an implementation for it — and all CRUD operations, filtering, sorting, and includes are handled through that single interface.EntityRepository provides the default implementation, but any custom class can be used instead.EntityControllerBase is sufficient: it registers the IEntityService automatically, requiring no additional wiring. The controller’s generic type arguments must match those used when configuring the entity (see example below).Main functionality of the service:
| Action | Purpose |
|---|---|
| Details | Get a single item by ID, with all registered Navigation properties included (RefetchAfterSave, globally or via SetReadBehavior(...) per entity, tunes the save endpoints’ response re-fetch) |
| List | Get a (filtered, sorted & paged) collection of items, usually with limited or no Navigation properties |
| Save | Create or Update an item, usually Navigation properties are excluded (when updating). However, child collections can be included |
| Remove | Delete an item |
Assuming a Repository with a DbContext is being used.
Read Pipeline:
Write Pipeline:
*: only executed when using API controllers
Pipeline Details:
basic sample setup which whill register a IEntityService for Category, Product and Order entities, using the default EntityRepository implementation.
```csharp no-compile
builder.Services
.UseRegira(LICENSE) // free tier and trial available
.UseEntities
// controllers
[ApiController, Route(“categories”)]
public class CategoryController : EntityControllerBase
Free tier available: this package (
Regira.Entities) is Apache-2.0 — the abstractions are free to reference anywhere. The implementation packages (Regira.Entities.EFcore,Regira.Entities.DependencyInjection,Regira.Entities.Web, the mapping packages) carry the Regira Commercial License; the registration packageRegira.Entities.DependencyInjectionvalidates keys, with a free tier of 5 simple + 2 complex entity registrations per application, and a license key is required beyond that. Register the key withservices.UseRegira(configuration)(readsRegira:LicenseKeys) before callingUseEntities(). Without a key the free tier applies automatically. Obtain a key at https://regira.com/licensing.
Paging defaults: set
options.DefaultPageSize/options.MaxPageSizein theUseEntities()callback (or per entity withe.SetPageSize(...)) so List/Search endpoints page automatically instead of returning the full set. See Web Endpoints → Paging.
AI-assisted setup: connect the hosted Regira MCP server (
https://mcp.regira.com/mcp) and your coding agent can search these docs, fetch examples, and scaffold entities end-to-end — see the setup guide.
Apache License 2.0 — this package contains no license validation and no runtime limits. See LICENSE. A few companion packages are commercially licensed with a free tier; see the licensing overview.