Elarion

Attributes

The full catalog of Elarion attributes — what each one triggers, its parameters, and their defaults.

A lookup-only catalog of every Elarion attribute, grouped by area. Each entry lists the package, what it applies to, a one-line "triggers", and a parameter table (type, default, meaning). For the behavior behind each attribute see the linked capability or concept page.

Parameters are listed as constructor arguments and init properties. Defaults are the literal defaults baked into the attribute. Enum value tables follow the group they belong to.

Modules & DI

[AppModule]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: groups handlers/services/validators/jobs/consumers under a module boundary and emits the {ModuleType}ElarionModuleServices.ConfigureDefaultServices sibling plus host bootstrapping; feature modules are gated by Modules:{Name}:Enabled.
ParameterTypeDefaultMeaning
namestring (ctor)requiredUnique module name; used for the feature-flag key Modules:{Name}:Enabled and logging.
KindAppModuleKind (init)FeatureFeature (optional, can be disabled) or Core (always enabled, ignores feature flags).
DependsOnstring? (init)nullComma-separated module names this module depends on; the generator topologically sorts so dependencies initialize first.

The class may optionally implement convention-based statics: ConfigureServices(IServiceCollection, IConfiguration), MapEndpoints(IEndpointRouteBuilder), GetJsonTypeInfoResolver(), and ConfigureEndpointGroup(IEndpointRouteBuilder).

AppModuleKind: Feature (= 0), Core (= 1).

See Modules.

[Service]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: source-generated DI registration. Without explicit service types, directly implemented interfaces are used as contracts; with none, the implementation type registers as itself. Base-class interfaces are not treated as explicit contracts.
ParameterTypeDefaultMeaning
serviceTypesparams Type[] (ctor) → IReadOnlyList<Type> ServiceTypesemptyExplicit contract types to register; when empty, contracts are inferred from directly implemented interfaces.
ScopeServiceScope (init)ScopedDI lifetime.

ServiceScope: Scoped, Singleton, Transient.

See Services.

[DecoratorList]

  • Package: Elarion.Abstractions (Pipeline) · Applies to: class
  • Triggers: declares the decorator types for an application-owned pipeline profile attribute so the generator can read the list at compile time. (Pipeline profile attributes themselves, e.g. DefaultPipelineAttribute, are application-defined, not framework-shipped.)
ParameterTypeDefaultMeaning
decoratorsparams Type[] (ctor) → DecoratorsemptyOrdered decorator types (open generics), applied outermost-first: the first type is the outermost decorator.

See Decorator pipelines.

Transports

[RpcMethod]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: marks a handler as a dispatcher-based RPC method (the handler must implement IHandler<TRequest, TResponse>). The method name is declared once and shared by every dispatcher transport; Transports selects JSON-RPC, MCP, or both. REST is a separate opt-in via [HttpEndpoint].
ParameterTypeDefaultMeaning
methodNamestring (ctor) → MethodNamerequiredThe JSON-RPC method name, e.g. "clients.create".
TransportsRpcTransports (init, [Flags])All (JsonRpc | Mcp)Which dispatcher transports expose the handler.

RpcTransports: JsonRpc (= 1), Mcp (= 2), All (= JsonRpc \| Mcp).

See JSON-RPC and MCP.

[McpMethod]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: optional MCP tool-name customization for a handler already on the MCP surface (its [RpcMethod] Transports includes Mcp). Purely additive — carries no enable/disable flag. Tool/parameter descriptions come from System.ComponentModel.DescriptionAttribute, not this attribute.
ParameterTypeDefaultMeaning
ToolNamestring? (init)nullOverrides the MCP tool name; when null/empty the name is derived from the RPC method name via the host's transform (e.g. "clients.create""clients_create").

See MCP.

[HttpEndpoint]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: marks a handler as an HTTP/REST endpoint; AppModuleDiscoveryGenerator emits the matching minimal-API MapGet/MapPost/… registration. The handler must implement IHandler<TRequest, Result<TResponse>>. With no explicit verb the verb is inferred from the request's CQRS marker (ICommand → POST, IQuery → GET); a request with neither marker requires an explicit verb (else ELHTTP004). Carries no ASP.NET Core dependency; a handler may carry both this and [RpcMethod].

The attribute has two constructors:

ConstructorParametersEffect
HttpEndpointAttribute(string route)route (required)Maps at route, inferring the verb from the request's ICommand/IQuery marker.
HttpEndpointAttribute(HttpVerb verb, string route)verb, route (both required)Maps at route with the explicit verb; sets HasVerb = true.

Read-only properties:

PropertyTypeDefaultMeaning
RoutestringrequiredThe route pattern, e.g. "clients/{id}".
VerbHttpVerbdefault(HttpVerb) = GetThe explicit HTTP method, or the default when HasVerb is false.
HasVerbboolfalseWhether Verb was set explicitly; when false the verb is inferred from the CQRS marker.

HttpVerb: Get, Post, Put, Patch, Delete.

See HTTP endpoints.

[GenerateModuleBootstrapper]

  • Package: Elarion.AspNetCore · Applies to: class
  • Triggers: marks a partial class to have its module bootstrapper generated by AppModuleDiscoveryGenerator — the single transport-wiring path; emits per-module and aggregate Map/Add methods for HTTP, JSON-RPC, and MCP, all module-scoped and feature-flag gated. Marker only — no parameters.

See Hosting.

Scheduling

[ScheduledJob]

  • Package: Elarion.Abstractions · Applies to: method | class
  • Triggers: marks a method as a compile-time scheduled job or a class as a runtime-schedulable job type. Methods must declare exactly one of FixedRate, FixedDelay, or Cron; runtime-schedulable classes may declare at most one. String values accept ${Config:Key} and ${Config:Key:-default} placeholders re-resolved per occurrence.
ParameterTypeDefaultMeaning
namestring (ctor) → NamerequiredStable unique job name used in logs, telemetry, and runtime scheduling.
FixedRatestring? (init)nullGrid-aligned interval between due times regardless of run duration. Accepts TimeSpan text or suffixes (50ms, 30s, 15m, 6h, 1d).
FixedDelaystring? (init)nullDelay between completion of one run and start of the next (polling-loop style). Same duration format; misfire policy does not apply.
Cronstring? (init)nullCron expression with 5 (minute-level) or 6 (second-level) fields, evaluated in TimeZone. "-" disables the schedule.
TimeZonestring? (init)null (UTC)Time-zone id used to evaluate Cron; passed to TimeZoneInfo.FindSystemTimeZoneById after placeholder resolution (prefer IANA ids).
InitialDelaystring? (init)nullOptional delay before the first execution (same format as FixedRate). Not valid with Cron.
RunOnStartbool (init)trueWhether interval jobs run once immediately at host start. Not valid with Cron.
Groupstring? (init)nullOptional key serializing jobs that must not run concurrently; jobs sharing a non-empty group share a serialization gate.
OverlapScheduledJobOverlap (init)SkipHow occurrences behave when another is already active.
MisfirePolicyScheduledJobMisfirePolicy (init)FireOnceHow fixed-rate/cron schedules handle missed in-process occurrences.
MaxConcurrentRunsint (init)0Max concurrently executing occurrences when Overlap = AllowConcurrent. 0 means no job-local cap (global scheduler limit still applies); negative is rejected by the generator.
Enabledstring? (init)null (always enabled)"true", "false", or a placeholder, evaluated per occurrence. An unconfigured placeholder without inline default means enabled; an unparseable value means disabled.

ScheduledJobOverlap: Skip, Queue, AllowConcurrent.

ScheduledJobMisfirePolicy: FireOnce (one overdue, skip intermediate), Skip, CatchUp.

See Scheduling, Schedules, and Overlap and misfire.

Events

[ConsumeEvent]

  • Package: Elarion.Abstractions · Applies to: method | class
  • Triggers: marks an event consumer, discovered by the event-consumer generator and registered as an EventSubscriptionDescriptor.
    • Handler form (preferred): on a class implementing IHandler<TEvent, Result<T>> (or IHandler<TEvent> sugar) whose request type is the event; runs through the full decorator pipeline. Role inferred from the response type: Result<Unit> = fan-out subscriber, Result<T> with T != Unit = single RequestAsync responder.
    • Method form: on a method of a [Service] class (no pipeline); plane taken from the message type marker (IDomainEvent/IIntegrationEvent), role from the return type.
ParameterTypeDefaultMeaning
Orderint (init)0Relative invocation order among fan-out subscribers of the same event, ascending. Equal orders run in a stable generator-determined sequence.

See Consuming events and Backends.

Caching

[Cacheable]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: marks a handler as cacheable and supplies compile-time metadata to the handler-registration generator. Only successful Result<T> responses are cached; failed results are returned but not stored.
ParameterTypeDefaultMeaning
tagsparams string[] (ctor) → TagsemptyLogical cache tags for grouping and invalidation.
DurationSecondsint (init)60Entry lifetime in seconds for both distributed and local cache layers.
ScopeHandlerCacheScope (init)CurrentUserWhether generated keys/tags are scoped to the current user or shared globally.
KeyPropertiesstring[] (init)[]Request property names included in the generated key; when empty, all public request properties are used. Invalid names are reported at build time.

HandlerCacheScope: CurrentUser (= 0), Global (= 1).

[CacheInvalidate]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: marks a mutating handler as invalidating cached entries for the given tags. Invalidation runs only after the inner handler returns a successful Result<T>; failed validation or business results do not evict cached reads.
ParameterTypeDefaultMeaning
tagsparams string[] (ctor) → TagsemptyLogical cache tags to invalidate after a successful handler result.
ScopeHandlerCacheScope (init)CurrentUserWhether invalidation applies to the current user's entries or globally shared entries.

See Caching.

Resilience

[ResiliencePolicy]

  • Package: Elarion.Abstractions · Applies to: class
  • Triggers: marks a static partial type as a source-generated resilience policy (a named execution behavior applied to handlers and scheduled jobs). Retry options create additional attempts after a handled exception; Timeout limits each individual attempt (not a total deadline across retries).
ParameterTypeDefaultMeaning
namestring (ctor) → NamerequiredStable policy name used by [Resilient] and ScheduledJobOptions.ResiliencePolicy.
MaxRetryAttemptsint (init)3Maximum retry attempts after the original attempt (0 = no retries; 3 = up to four total). Supplying this or another retry property enables retry generation.
Delaystring (init)"2s"Base delay before a retry, e.g. 200ms, 2s, 5m, or TimeSpan text. May be changed by Backoff, capped by MaxDelay, randomized by UseJitter.
BackoffResilienceBackoffType (init)ConstantHow retry delays grow between attempts.
MaxDelaystring? (init)nullOptional maximum retry delay after applying Backoff; used with linear/exponential backoff to cap waits.
UseJitterbool (init)falseWhether retry delays include jitter so many failures do not retry at the same instant.
Timeoutstring? (init)nullOptional per-attempt timeout, e.g. 30s or TimeSpan text. Not a total deadline across retries; cancels the attempt token.

ResilienceBackoffType: Constant, Linear, Exponential.

[Resilient]

  • Package: Elarion.Abstractions · Applies to: class | method
  • Triggers: applies a named resilience policy to a generated handler or scheduled-job invocation. On handlers and compile-time jobs the policy executes inline around the current invocation; runtime scheduled jobs can alternatively use ScheduledJobOptions for scheduler-deferred retry.
ParameterTypeDefaultMeaning
policyNamestring (ctor) → PolicyNamerequiredStable policy name registered by a [ResiliencePolicy] type or a manual resilience pipeline registration.

See Resilience.

EF Core

[DbEntity]

  • Package: Elarion.EntityFrameworkCore · Applies to: class
  • Triggers: marks an entity class for inclusion in the DbContext; the source generator scans for it to auto-generate DbSet properties.
ParameterTypeDefaultMeaning
scopesparams string[] (ctor) → Scopes (IReadOnlyList<string>)emptyOptional context scopes this entity belongs to. Omit scopes to participate in unscoped/global contexts.

[GenerateDbSets]

  • Package: Elarion.EntityFrameworkCore · Applies to: interface
  • Triggers: applied to a partial DbContext interface; generates DbSet<T> properties for each [DbEntity] class, DbSet<T> properties on implementing DbContext classes, and ConfigureEntities(ModelBuilder) on implementing DbContext classes.
ParameterTypeDefaultMeaning
scopesparams string[] (ctor) → Scopes (IReadOnlyList<string>)emptyOptional context scopes generated for this interface. Omit scopes to include every [DbEntity].

[Keyset<TEntity>]

  • Package: Elarion.Paging · Applies to: class (generic attribute, where TEntity : class)
  • Triggers: declares an ordered keyset (seek) definition for TEntity on the annotated partial class. The EF Core generator fills the class with a reflection-free IKeysetDefinition<TEntity> implementation (ordering, seek predicate, opaque cursor codec) plus a static Definition singleton, so handlers page via source.ToKeysetPageAsync(request, MyKeyset.Definition, selector). Declared on a dedicated partial class (not the entity), so an entity may have any number of orderings. Non-partial or nested keyset classes are reported (ELKEY005).
ParameterTypeDefaultMeaning
TEntitytype parameter (where TEntity : class)requiredThe entity type being paginated.
columnsparams string[] (ctor) → Columns (IReadOnlyList<string>)emptyOrdered keyset column names in precedence order; each names a property on TEntity. Ascending by default; a leading - marks the column descending (e.g. "-CreatedAt"). The final column should be unique (typically the primary key) for determinism.

See Entity Framework and Pagination.

Cross-module communication

[ModuleContract]

  • Package: Elarion.Abstractions (Modules) · Applies to: interface | class
  • Triggers: marks a module's published cross-module surface — the stable type other modules may depend on. The owning module keeps the implementation internal; other modules inject the contract. ModuleBoundaryAnalyzer (ELMOD002) reports cross-module references to internal [Service]/handler/entity types but allows references to a [ModuleContract] type. Marker only — no parameters.

[ModuleApi]

  • Package: Elarion.Abstractions (Modules) · Applies to: class
  • Triggers: configures how a handler participates in its module's generated typed in-process API (see [GenerateModuleApi]). A configurator, never a gate: every handler is in the default facade automatically (opt-out). Apply only to exclude a handler or to tag it into named scopes (additive). Scope vocabulary mirrors [DbEntity]/[GenerateDbSets].
ParameterTypeDefaultMeaning
scopesparams string[] (ctor) → Scopes (IReadOnlyList<string>)emptyNamed scopes this handler is tagged into so it also appears on matching scoped facades. Empty means the handler participates only in the module's default (unscoped) facade.
Excludebool (init)falseWhen true, the handler is excluded from every generated facade, scoped or default.

[GenerateModuleApi]

  • Package: Elarion.Abstractions (Modules) · Applies to: interface
  • Triggers: marks a partial interface to be filled with a typed in-process API over the owning module's handlers — one method per handler, dispatched typed-direct to IHandler<TRequest, TResponse> (full decorator pipeline, no serialization). Not a transport and absent from the JSON-RPC/MCP schema; module-internal (must not cross boundaries). The interface must be partial and at namespace scope. Diagnostics ELAPI001ELAPI004.
ParameterTypeDefaultMeaning
scopesparams string[] (ctor) → Scopes (IReadOnlyList<string>)emptyThe scopes this facade selects. Empty = default facade (every non-excluded handler in the owning module by longest-prefix namespace match); one or more = only handlers tagged with an intersecting scope via [ModuleApi].

See Cross-module communication.

Assembly opt-ins

[UseElarion]

  • Package: Elarion.Abstractions · Applies to: assembly
  • Triggers: enables all Elarion source-generation features at once — equivalent to applying [GenerateModuleHandlers], [GenerateModuleServices], [GenerateModuleValidators], [GenerateScheduledJobs], [GenerateEventConsumers], and [GenerateResiliencePolicies]. Application-owned attributes such as pipeline defaults remain explicit. Marker only — no parameters.

Individual generation triggers

All are Elarion.Abstractions, applied to the assembly, marker-only (no parameters), and subsumed by [UseElarion].

AttributeTriggers
[GenerateModuleHandlers]Per-module handler registration methods.
[GenerateModuleServices]Per-module service registration methods.
[GenerateModuleValidators]Per-module validator registration methods.
[GenerateScheduledJobs]Source-generated scheduler descriptor registration.
[GenerateEventConsumers]Source-generated event-consumer descriptor registration.
[GenerateResiliencePolicies]Source-generated resilience-policy registration.

[UseElarionEntityFrameworkCore]

  • Package: Elarion.EntityFrameworkCore · Applies to: assembly
  • Triggers: declares the target database provider so EF Core generators can emit provider-optimized variants (the EF Core analogue of [assembly: UseElarion]). When omitted, generators behave as Portable and emit provider-neutral code.
ParameterTypeDefaultMeaning
ProviderEfCoreProvider (init)Portable (= 0)Target database provider.

EfCoreProvider: Portable (= 0, provider-neutral code), Npgsql (= 1, opts generated keyset seek predicates into PostgreSQL row-value comparisons; requires the Npgsql EF Core provider be referenced).

See Entity Framework.

On this page