I need to perform edits on my saga documents outside of the saga. I am trying to do the simple property update which is:
SaleSaga saga = session.Load<SaleSaga>(id);
saga.SaleSagaTaskId = taskId;
session.SaveChanges();
This does not work, I end up with this issue.
{"Entity Messages.SaleSaga had document key 'salesaga/d6b639c4-78a1-4be6-8e44-a283010b11a9'
but now has document key property 'salesagas/d6b639c4-78a1-4be6-8e44-a283010b11a9'
.\r\nYou cannot change the document key property of a entity loaded into the session"}
I am not sure why it is adding an 's' on to the end of "salesagas". I'm at a loss as to the best way to resolve this, any help would be greatly appreciated.
EDIT: This is for an NServiceBus saga and the error is occurring when attempting to save the edited document back to RavenDB.