I can't seem to get the Changes API event to fire.
I subscribe and I have tried changing a document via the Studio as well as making a change in code via the client, but the change API never fires.
Environment:
Ideas?
Here's my simple code:
private void SubscribeToDbChanges()
{
Store
.Changes()
.ForDocumentsInCollection<ReferenceDataProvider>()
.Subscribe(change =>
{
Console.WriteLine("Data subscription changed");
Reinitialize();
});
}
Try the following code:
var subscription = Store.Changes();
await subscription.EnsureConnectedNow();
var observableWithTask = subscription
.ForDocumentsInCollection<ReferenceDataProvider>();
observableWithTask.Subscribe(change =>
{
Console.WriteLine("Data subscription changed");
Reinitialize();
});
await observableWithTask.EnsureSubscribedNow();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With