For<>() without TSortBy/TIncludes type parameters; complex = with them. For paid limits, add a Regira:LicenseKeys array to appsettings.json and call services.UseRegira(configuration) before UseEntities(). A single key can cover multiple products; add more keys to the array to combine them — the system picks the best per product. Obtain a key at https://regira.com/licensing.DbContext)
.UseEntities()
options.DefaultPageSize / options.MaxPageSize, or per-entity e.SetPageSize(...)) so List/Search endpoints don’t return the full set (optional).WithAttachments() when using attachmentsWhen implementing a new entity in an application:
Required
SetDecimalPrecisionConvention in DbContext over setting precision on each propertyUseEntities<TContext>(e => e.UseDefaults()). A DbContext you construct yourself takes .AddArchivedQueryFilter() on its options builder — startup validation fails with an error naming the entity when a model ends up without the filterUseEntities(e => e.UseDefaults()) — DateTime values round-trip as UTC (JSON Z suffix).For<TEntity>()EntityControllerBase controller for each entityDatabase.EnsureCreated() and keep the local database disposableRecommended (when using API)
Optional
.For<>() registration or controller; it rides on the parent’s endpoints. Adding one for a dedicated route is fine provided the parent’s input DTO leaves that collection nullSortOrder must travel on the parent DTO (position drives SetSortOrder()), so the collection can’t be omitted — guard any per-row field with a Prepare hook, and keep the child’s FK on its input DTOExtra
.WithAttachments(factory) (registers the shared Attachment entity + store + primer)EntityAttachment subclass (inherit EntityAttachment, set ObjectType in the constructor)IHasAttachments / IHasAttachments<TAttachment> on the owning entityDbSet<Attachment> + DbSet<TAttachment> and configure relationships in DbContext.For<Owner>(e => e.HasAttachments<TContext, Owner, TAttachment>(x => x.Attachments)): EntityAttachmentControllerBase<TAttachment> with the owner base [Route] only