Closed SebastianKuesters closed 1 year ago
@robinmanuelthiel pls give me feedback on this feature request.
I don’t like this idea at all, as see a bunch of anti-patterns here.
First of all, IMHO a query should always only work exactly one way. In this case by passing the SharedLink
object in the constructor. In cases where I only have the Guid
at hand, I should use a different query (e.g. GetSharedLinkQuery
) first and then pass the result into this query.
This would make calls a lot simpler and especially clearer in terms of easier to read and to follow.
Not a big fan of magic pre-processors which are hidden to the caller anyways
Like the approach of forcing two queries here, which prevents code duplication if a GetSharedLinkQuery
is needed one day.
We should come up with written down rules and best-practises on how we write and sctructure Queries (and Commands) across our projects!
Documented https://github.com/wemogy/libs-cqrs/pull/52
As a developer I want to have the option to define a
IQueryPreProcessor
for my query. This could be useful in the following sample:Given is the following query:
For this I would like to add a PreProcessor, which requests the
SharedLink
entity from the database, if the constructor with theGuid
parameter was used. Using this I can ensure, that in theIQueryHandler
implementation both properties are always set, so that I can focus on the Core logic.