Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using aggregate handlers for fetching an aggregate without return events or messages #646

Open
erdtsieck opened this issue Dec 5, 2023 · 0 comments

Comments

@erdtsieck
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Sometime is just want to do something based on a message, but using information from my Marten aggregate. But the following code:

[AggregateHandler]
public static async Task HandleAsync(FooCommand command, Foo foo)
{
    // .. do stuff, but no events or messages to return
}

gives me the error:

No events are emitted from handler FooHandler handled by FooHandler.HandleAsync() even though it is marked as an action that would emit Marten events. Either return the events from the handler, or use the IEventStream service as an argument.

Describe the solution you'd like
No error, just execute

Describe alternatives you've considered
I now return an empty events or outgoingmessages array

Additional context
Discussed on Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant