Repository navigation
Release v22.83.0
Summary
[GeneratedValue] handler parameters now support concepts whose generation depends on time or tenant, and command scenarios can fix that time and tenant. New analyzers guide inline value generation into generated parameters.
Added
- A
[GeneratedValue]parameter whose concept implementsIGeneratableInContext<T>from Cratis Fundamentals 7.24 is created with aGenerationContextholding the command's received time and the current tenant (the default tenant maps toGenerationContext.DefaultTenant). When a concept implements bothIGeneratable<T>andIGeneratableInContext<T>, the context form is used. A command without a received time fails instead of falling back to the system clock (#3165) CommandScenario.Clock(DateTimeOffset)andCommandScenario.Tenant(TenantId)fix the time and tenant a scenario's commands run with, including nested commands. SetClockbefore the firstExecuteorValidateandTenantbefore the firstExecute; later changes throw (#3165)ARC0027warns when a generated parameter's type implements both generation interfaces, since Arc only calls the context form (#3165)ARC0028reports a generatable concept created insideHandle(X.New()orGenerateValue.*) and offers a code fix that moves it to a[GeneratedValue]parameter, so scenarios can pin the value (#3165)ARCCHR0022warns when a command injects an aggregate keyed by the command's event source while appending its events to a generated event source (#3165)