Class MissingCommandResultFactory

Namespace
Cratis.Arc.Commands
Assembly
Cratis.Arc.Core.dll

The exception that is thrown when a command response cannot be wrapped in a CommandResult<TResponse> because no factory was generated for its runtime type and the code is ahead-of-time compiled, as under NativeAOT.

public class MissingCommandResultFactory : Exception, ISerializable
Inheritance
MissingCommandResultFactory
Implements
Inherited Members
Extension Methods

Remarks

Thrown only when no factory is registered for the runtime type of the response and creating the result through reflection is not supported, which happens in ahead-of-time compiled code such as NativeAOT. Under the JIT, including apps built with PublishAot that run from dotnet run or a test host, such responses are wrapped through reflection. The Arc source generator emits factories for the concrete response types a command's Handle method declares. Declare the concrete response type rather than a base type, interface or object.

Constructors

MissingCommandResultFactory(Type, Exception)

The exception that is thrown when a command response cannot be wrapped in a CommandResult<TResponse> because no factory was generated for its runtime type and the code is ahead-of-time compiled, as under NativeAOT.

public MissingCommandResultFactory(Type responseType, Exception innerException)

Parameters

responseType Type

The runtime type of the response.

innerException Exception

The failure from creating the result through reflection.

Remarks

Thrown only when no factory is registered for the runtime type of the response and creating the result through reflection is not supported, which happens in ahead-of-time compiled code such as NativeAOT. Under the JIT, including apps built with PublishAot that run from dotnet run or a test host, such responses are wrapped through reflection. The Arc source generator emits factories for the concrete response types a command's Handle method declares. Declare the concrete response type rather than a base type, interface or object.