Comments (4)
Hi Diego,
In the v2 implementation it was required to pass the client and database name, and container name to generate the URL to do a call to Cosmos DB. With this new implementation we removed the need to generate URLs, and allowed the ability to do dependency injection. With the new implementation you can simply pass the CosmosContainer object everywhere. It's recommended to cache the object to avoid the additional load to create it. The application should only check if the database and container exists on the initial application startup, and there should only be one CosmosClient to prevent performance issues. The code is here if you want to see how it is implemented.
CosmosContainer container = this.cosmosClient.Databases["myDb"].Containers["myContainer"];
If this does not fix your issue can you please provide some samples?
from azure-cosmos-dotnet-v3.
@j82w That does enable our scenario, though this API has low discoverability.
from azure-cosmos-dotnet-v3.
We can increase the documentation around this scenario, and add more samples to prevent this in the future.
@kirankumarkolli and @kirillg do you think it might be worth adding methods like GetDatabase to increase exposure on how to get the objects other than the index overload?
from azure-cosmos-dotnet-v3.
@AndriySvyryd we are changing the API to make it easier to discover. I'm closing this issue please look at #333
from azure-cosmos-dotnet-v3.
Related Issues (20)
- ReadMany: Dynamically choose between point read and query
- Aspire: usage identification through user-agent
- Request for Detailed Examples on Implementing Multi-Tenancy with Cosmos DB SDK for .NET HOT 1
- Distributed Tracing: Add db.statement attribute
- Change Feed: Mongo API AllVersionsAndDeletes support on Compute Gateway HOT 1
- Cosmos DB deserializer fails silently - GetItemQueryIterator HOT 2
- Add Internal/Friends Execute Stored Procedure Function With PK Range Id Option HOT 4
- Expose DB Built-in Data Reader or Cosmos DB Built-in Data Contributor roles to IAM role list. HOT 5
- Push partition key to epk range resolution out of RequestInvokerHandler to consumers HOT 4
- Distributed Tracing: Add RequestChargeThreshold to CosmosThresholdOptions HOT 4
- LINQ: Enums convertor using System.Text.Json is not working HOT 6
- [FEATURE REQ]Immediately trigger cross-regional fail-over on 410/LeaseLost
- Feed iterator documentation issues HOT 4
- [FEATURE REQ] Avoid blocking Asynchronous calls as it leads to thread starvation.
- Document ReadItemAysnc item not found behavior HOT 1
- FormatException when getting IndexMetrics from responseMessage HOT 2
- Casting To ContainerInternal Prevents Proper Unit Testing Patterns HOT 1
- Improve client initialization ergonomics HOT 2
- Allow setting RequestTimeout at request level, rather than CosmosClient level HOT 2
- Missing NuGet package 3.39.0 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-cosmos-dotnet-v3.