diff --git a/src/Http/Wolverine.Http/CodeGen/QueryStringBindingFrame.cs b/src/Http/Wolverine.Http/CodeGen/QueryStringBindingFrame.cs index 5a6ae5b27..e64425127 100644 --- a/src/Http/Wolverine.Http/CodeGen/QueryStringBindingFrame.cs +++ b/src/Http/Wolverine.Http/CodeGen/QueryStringBindingFrame.cs @@ -28,6 +28,8 @@ public bool TryMatch(HttpChain chain, IServiceContainer container, ParameterInfo if (parameter.ParameterType.IsTypeOrNullableOf()) return false; if (parameter.ParameterType.IsTypeOrNullableOf()) return false; + chain.ComplexQueryStringType = parameter.ParameterType; + variable = new QueryStringBindingFrame(parameter.ParameterType, chain).Variable; return true; } diff --git a/src/Http/Wolverine.Http/HttpChain.cs b/src/Http/Wolverine.Http/HttpChain.cs index c239ce12a..f32388251 100644 --- a/src/Http/Wolverine.Http/HttpChain.cs +++ b/src/Http/Wolverine.Http/HttpChain.cs @@ -281,7 +281,7 @@ public override bool HasAttribute() public override Type? InputType() { - return HasRequestType ? RequestType : null; + return HasRequestType ? RequestType : ComplexQueryStringType; } public override Frame[] AddStopConditionIfNull(Variable variable) @@ -642,6 +642,7 @@ public HttpElementVariable GetOrCreateHeaderVariable(IFromHeaderMetadata metadat public bool HasRequestType => RequestType != null && RequestType != typeof(void); public bool IsFormData { get; internal set; } + public Type? ComplexQueryStringType { get; set; } internal Variable BuildJsonDeserializationVariable() { diff --git a/src/Persistence/Wolverine.Marten/AggregateHandlerAttribute.cs b/src/Persistence/Wolverine.Marten/AggregateHandlerAttribute.cs index 273b429d7..63a34662d 100644 --- a/src/Persistence/Wolverine.Marten/AggregateHandlerAttribute.cs +++ b/src/Persistence/Wolverine.Marten/AggregateHandlerAttribute.cs @@ -76,8 +76,10 @@ public override void Modify(IChain chain, GenerationRules rules, IServiceContain CommandType = chain.InputType(); if (CommandType == null) + { throw new InvalidOperationException( $"Cannot apply Marten aggregate handler workflow to chain {chain} because it has no input type"); + } AggregateType ??= DetermineAggregateType(chain);