Below is the update code to update the existing entity in the RavenDB. The below code sometimes works and sometimes does not work.
using var session = GetDocumentStore().OpenAsyncSession();
var stored = await session.LoadAsync<Bundle>(bundle.Id);
stored = Mapper.Map(bundle, stored);
await session.SaveChangesAsync();
There is neither any exceptions nor warning when above code block is executed when the update does not happen. Let me know if more stuffs are required from my end to support the question.
I need to verify whether the update is successful or not. Is there any approach to verify whether the update is success in RavenDB?
Based of THIS document, SaveChangesAsync is Void Type. So in my opinion there is two option:
1-Using a Try… Catch block in this case if any exception is thrown by the DB you can handle it.
2-if validating is that much important. You can fetch it by the ID and then validate.