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

Need to assert on identity type mismatch in FetchForWriting() #2454

Closed
jeremydmiller opened this issue Jan 11, 2023 · 1 comment · Fixed by #2501
Closed

Need to assert on identity type mismatch in FetchForWriting() #2454

jeremydmiller opened this issue Jan 11, 2023 · 1 comment · Fixed by #2501

Comments

@jeremydmiller
Copy link
Member

Had a user issue the other day. When using the FetchForWriting() functionality, the aggregate document identity type has to match the stream type in order to function. We need to make the exception be very clear about what's wrong when this happens.

@jeremydmiller jeremydmiller added this to the 6.0.0 milestone Jan 11, 2023
@dgrozenok
Copy link

I don't remember why (maybe based on some older examples), but I had this line in the Marten configuration code for the Product aggregate:

_.Events.AddEventType(typeof(Product));

As a result the issue with the mismatch reproduced to me. When I removed that line everything started working normal. According to the description of that AddEventType method it's optional, but helps Marten in some way. How would I need to call it not to break the FetchForWriting()?

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

Successfully merging a pull request may close this issue.

3 participants