.NET SDK for Azure Cosmos DB for the core SQL API
Перейти к файлу
Sourabh Jain 6715d249e0 adding test 2024-09-18 22:13:04 +05:30
.github
Microsoft.Azure.Cosmos adding test 2024-09-18 22:13:04 +05:30
Microsoft.Azure.Cosmos.Encryption [Internal] Query : Fixes response parsing error for ReadFeed by limiting binary format to query operations (#4515) 2024-05-29 03:16:05 +00:00
Microsoft.Azure.Cosmos.Encryption.Custom [Client Encryption]: Adds support for latest Cosmos Package. (#4546) 2024-06-20 19:15:07 +00:00
Microsoft.Azure.Cosmos.Samples [Internal] FaultInjection: Adds Fault Injection to main project (#4633) 2024-08-07 15:03:50 -07:00
docs [Internal] Documentation: Adds details about retry backoff for 410/449 (#4445) 2024-04-22 22:03:37 +00:00
templates [Internal] Pipelines: Refactors YML files to use OneES Pools for pipelines (#4514) 2024-05-29 08:51:30 -07:00
.editorconfig
.gitattribute
.gitignore
.sscignore
35MSSharedLib1024.snk
CODEOWNERS [Internal] CODEOWNERS: Refactors owners (#4642) 2024-08-15 20:48:06 +00:00
CONTRIBUTING.md
CredScanSuppressions.json
Directory.Build.props Bump up the cosmos.direct package version. (#4687) 2024-09-13 17:52:34 +00:00
Exceptions.md
LICENSE
Microsoft.Azure.Cosmos.sln [Internal] FaultInjection: Adds Fault Injection to main project (#4633) 2024-08-07 15:03:50 -07:00
PULL_REQUEST_TEMPLATE.md
README.md
SECURITY.md
SdkDesignGuidelines.md
ThirdPartyNotice.txt
UpdateContracts.ps1
UpdateDotNetVersion.ps1
azure-pipelines-cron.yml
azure-pipelines-ctl-publishing.yml [Internal] Pipelines: Adds demands to ctl (#4562) 2024-06-28 08:22:56 -07:00
azure-pipelines-encryption-custom.yml [Internal] Pipelines: Refactors YML files to use OneES Pools for pipelines (#4514) 2024-05-29 08:51:30 -07:00
azure-pipelines-encryption.yml [Internal] Pipelines: Refactors YML files to use OneES Pools for pipelines (#4514) 2024-05-29 08:51:30 -07:00
azure-pipelines-functional.yml
azure-pipelines-nightly.yml
azure-pipelines-official.yml Quarantine ClientTelemetryReleaseTests (#4539) 2024-06-12 07:17:27 -07:00
azure-pipelines-rolling.yml [Internal] Pipelines: Adds rolling pipeline (#4460) 2024-04-30 13:03:41 -07:00
azure-pipelines.yml [Internal] Pipelines: Fixes Multi-Region CI pipeline to include env variable (#4363) 2024-03-25 14:19:04 -07:00
changelog.md SDK 3.43.0: Adds version bump and changelog (#4666) 2024-09-04 20:08:59 +00:00
repo.config
testkey.snk

README.md

NuGet NuGet Prerelease

Microsoft Azure Cosmos DB .NET SDK Version 3

This client library enables client applications to connect to Azure Cosmos DB for NoSQL. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to https://azure.microsoft.com/services/cosmos-db/.

CosmosClient client = new CosmosClient("https://mycosmosaccount.documents.azure.com:443/", "mysupersecretkey");
Database database = await client.CreateDatabaseIfNotExistsAsync("MyDatabaseName");
Container container = await database.CreateContainerIfNotExistsAsync(
    "MyContainerName",
    "/partitionKeyPath",
    400);

// Create an item
dynamic testItem = new { id = "MyTestItemId", partitionKeyPath = "MyTestPkValue", details = "it's working", status = "done" };
ItemResponse<dynamic> createResponse = await container.CreateItemAsync(testItem);

// Query for an item
using (FeedIterator<dynamic> feedIterator = container.GetItemQueryIterator<dynamic>(
    "select * from T where T.status = 'done'"))
{
    while (feedIterator.HasMoreResults)
    {
        FeedResponse<dynamic> response = await feedIterator.ReadNextAsync();
        foreach (var item in response)
        {
            Console.WriteLine(item);
        }
    }
}

Install via Nuget.org

Install-Package Microsoft.Azure.Cosmos

For available versions, see SDK versioning.

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Resources:

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.