Open togakangaroo opened 10 years ago
@togakangaroo Unless I dont understand the question, Commands don't return anything, as you can see Handle
is void. Use a Query if you need to return something.
I am also confused. Commands should not return anything, but if a command is to save a data do the database and get a new ID, how is this new ID supposed to get back to the client if a command can´t return a value ?
Use IQuery (or in the latest IRequest?) when data is needed to be returned.
var data = mediator.Request(query).Data;
https://github.com/mhinze/ShortBus/blob/master/ShortBus.Tests/Example/BasicExample.cs
I tried to create a simple command handler as in the example on the README but this is giving me a compilation error due to
Handle
not returning anything.Versioning: