0

I am unable to update the entity relationship in my saga instance event.

I am able to create One-to-One row for an entry however while I come back to IssueLocation state again it is not detecting row is already exist and thorwing error

here is my code https://github.com/jaisopenoffice/IssueRequestStateMachine/tree/master

I need to update IssueLocation instead of adding new record(at IssueTypeAccepted event). First time it is working but when I come back to the same state again that's where it is trying to create new record. Is there a right way to do it?

JasKevs
  • 9
  • 1
  • 3
  • How are the other events CorrelationId being initialized, which in the case of a saga, much match the existing saga instance? You may need to correlate on some other identifier that your event producers know. – Chris Patterson Aug 15 '17 at 16:16
  • Yes, I am using CorrelationId to map between events and it is expecting to match existing saga instance. While loading the object-graph it is bringing child objects as null. For example, in Step 3[IssueDetails step] the IssueLocation object is showing as null which I already set at Step 2 – JasKevs Aug 16 '17 at 00:07
  • Try to make it work without MassTransit - add IssueLocation, save changes, read it again. I bet you get null there too. Fix your mappings and it will work as saga too. This is just EntityFramework. – Alexey Zimarev Aug 16 '17 at 11:14
  • I was able to make it work outside of MT by only using "include" in EF which is not possible to move my code to MT – JasKevs Aug 22 '17 at 05:49
  • Have you made any samples of EF & MT with object relationships in its Saga State Machine Instance? It will be easier to figure out that way – JasKevs Aug 22 '17 at 23:32

0 Answers0