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

Relate to another entity and get it #57

Closed
miltoncamara opened this issue Oct 25, 2017 · 3 comments
Closed

Relate to another entity and get it #57

miltoncamara opened this issue Oct 25, 2017 · 3 comments

Comments

@miltoncamara
Copy link

How to relate an entity to another entity? I have to use the AggregationId as Foreign Key or a Id Version data? When I need an specific version how I do to get it?

@gautema
Copy link
Owner

gautema commented Oct 26, 2017

Hi.

There is no built in way to relate one entity to another. I'm not sure I understand what you want, but you if you want to check if another aggregate exists or has some property, you could load several aggregates in the command handler or query against a read model here.

If you want to get a specific version of an aggregate there is currently no support for it. Again I think I need a bit more context to understand the problem completely.

@miltoncamara
Copy link
Author

Assuming that I have a product entity and this product is related to an order, at a given time the product value was "100" but today this value is 50. What I would like to know is, what was the value of that order, remembering that it was 50 and today it is 100.

@gautema
Copy link
Owner

gautema commented Oct 27, 2017

I see. I think I would have solved this by saving the value in the order when it was made. It could read of a readmodel. I never do reads from other aggregates directly, but use read models to get their state. Anyway, there is no built in support to this scenario in CQRSlite.

@gautema gautema closed this as completed Nov 29, 2017
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

2 participants