Is it OK to use the DbContext used by MassTransit to store the StateMachines as a regular DbContext?
In my application we want to implement the following scenario (removed validation and err handling):
The progress and status of the queue request should be queryable through the api.
If I read the docs correctly this is what StateMachine and Saga are used for. The saga is working and tested, but now I want to implement the part where I can query the state information.
Should I use the EFCore DbContext that is used as persistance for MassTransit as a regular DbContext?
Is there an existing way to better communicate this data store is not for writing outside masstransit?
Is there a better way to interrogate a StateMachine or Saga?
A DbContext
is just that, there isn't anything special about it. So, you can certainly use it to query status. There are also other options to query status from a saga state machine using request/response. Various examples cover these details.
From your description, I'd suggest looking at Sample-Batch which seems to do something similar to what you're trying to accomplish.