'Dynamic container name when mapping Cosmos DB using EF Core

I have an OData endpoint which query collection of Cosmos entity. The Cosmos DB container name is dynamic so that I cannot use entity.ToContainer("<container name>") in the model creation.

The container name is only known when the OData endpoint is called.

Does anybody know how we can query using OData with a dynamic Cosmos DB container name?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source