Hello all,
This question is somewhat of a followup from a previous one that I had regarding command interceptors that can be found here.
I’ve seen in other posts mentions of using an entity manager to be able to query against aggregates. This made me wonder if it was necessary for me to be creating command side projections when validating a command in an interceptor when there is context required outside the scope of a single aggregate.
Using the example I had in the post linked above, I need to know that there is an account, and a business, before creating a loyalty bank. Is there a way that I could just query the aggregates directly from within the interceptor? If so, what are the disadvantages if any?
I initially went with the notion of “command projections” based on some other posts and a podcast that I listened to, and am overall happy with the results. But if there is a way to do this directly with the aggregates I don’t see why the projections would be needed.
Thanks for you time!