Closed johnmillard-ra closed 3 years ago
@Sagilio
EFCore Adapter does not have any special behavior for Cosmos DB in the current version, so you may need to call LoadPolicy
or LoadPolicyAsync
when watched the changes.
You can use IWatcher
to keep the same policy between instances. It will call Update()
or UpdateAsync()
method when you call the Add/Remove/Update policy APIs.
Excellent - thank you!
Hello!
Once again, I apologize if there's information I overlooked, or if this is the wrong place to ask this question. As I understand things, Cosmos handles replication across regions, so any policies added or removed in one region will replicate to all other regions (assuming that's what we want and assuming we've configured things correctly).
Is there anything inherent in this adapter that facilitates this behavior? i.e. If I write a policy in Europe, Cosmos will replicate that policy to the US, Asia, etc. - does this adapter ensure that calls to Enforce() hit Cosmos if caching is disabled, absent a preceding call to LoadPolicy()?
Or do I need to watch for changes to the database/container separately, triggering calls to LoadPolicyAsync() in response?
Thanks for your patience! John