Repository navigation
Release v22.66.0
Summary
A command handler can now take a server-generated value as a Handle parameter instead of calling New() inside the handler. The value is never part of the request, and specs will be able to pin it by name. This is the first part of generated values: the scenario pinning API and analyzers follow.
Added
[GeneratedValue]and[GeneratedValue("name")]on a model-bound command'sHandleparameter: Arc creates the value with the type'sIGeneratable<T>.New()(for example a UUID-backed concept), validates it with the concept's validator, and passes it to the handler. It never becomes a request property, so clients cannot choose it. A value the concept's validator rejects is a server error, not a validation response. (part of #3128)CommandContext.GeneratedValueslists the values generated for the command, in resolution order. Generated values are never written to logs or exception messages. (part of #3128)- A source generator registers an AOT-safe factory for each generatable type used in a
[GeneratedValue]parameter. Without one, Arc falls back to reflection, and an AOT application refuses to start with an error that names the command and parameter. (part of #3128) - A documentation page on generated values in commands: when to use them, how they are created and validated, and the pitfalls. (part of #3128)
Changed
- Arc depends on Cratis.Fundamentals 7.23.0. (part of #3128)