.NET SDK for Azure Cosmos DB for the core SQL API
Перейти к файлу
Sourabh Jain 81b48f0e47 users/sourabhjain/benchmarkfix 2023-01-30 16:02:57 +05:30
.github [Internal] PRLint: Fixes configuration to avoid PR being blocked (#3463) 2022-09-20 15:10:30 +00:00
Microsoft.Azure.Cosmos Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664) 2023-01-26 11:36:56 -08:00
Microsoft.Azure.Cosmos.Encryption Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642) 2023-01-19 06:32:16 -08:00
Microsoft.Azure.Cosmos.Encryption.Custom Client Encryption: Fixes System.Text custom serializer issue with DataEncryptionKeyContainer operations. (#3386) 2022-08-19 09:08:37 -07:00
Microsoft.Azure.Cosmos.Samples users/sourabhjain/benchmarkfix 2023-01-30 16:02:57 +05:30
docs [Internal] Documentation: Refactors cache content on its own document (#3554) 2022-11-09 11:04:47 -08:00
templates [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556) 2022-11-10 22:29:39 +00:00
.editorconfig editorcofig: Adds editorcofig rules for all the VS defaults (#1827) 2020-09-18 11:53:35 -07:00
.gitattribute [INTERNAL] Line endings: Adds gitattribute to normalize line endings (#3062) 2022-03-03 20:09:51 +00:00
.gitignore
.sscignore [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589) 2022-11-29 06:38:22 -08:00
35MSSharedLib1024.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) 2019-09-10 19:57:58 +05:30
CODEOWNERS Codeowners: Removes old owners (#3330) 2022-07-07 13:01:03 -07:00
CONTRIBUTING.md [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556) 2022-11-10 22:29:39 +00:00
CredScanSuppressions.json
Directory.Build.props Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642) 2023-01-19 06:32:16 -08:00
Exceptions.md Documentation: Adds retry statements to exception document (#2076) 2020-12-21 10:20:28 -08:00
LICENSE
Microsoft.Azure.Cosmos.sln Client Encryption : Adds new Encryption.Custom package (#2682) 2021-09-16 05:18:15 -07:00
PULL_REQUEST_TEMPLATE.md [Internal] PR Lint: Fixes to use new title regex (#1699) 2020-07-14 13:51:25 -07:00
README.md [Internal] README: Fixes code example 2022-10-07 12:07:53 -07:00
SECURITY.md Microsoft mandatory file (#3203) 2022-05-19 10:45:45 -07:00
SdkDesignGuidelines.md Documentation: Adds SDK guidelines (#1803) 2020-08-26 21:11:27 +05:30
ThirdPartyNotice.txt [Internal] Parser: Adds Antlr Dependancy (#1691) 2020-09-23 09:33:21 -07:00
UpdateContracts.ps1 .NET 6: Refactors test and samples to use .NET 6 (#2986) 2022-01-19 11:29:59 -08:00
UpdateDotNetVersion.ps1 .NET 6: Refactors test and samples to use .NET 6 (#2986) 2022-01-19 11:29:59 -08:00
azure-pipelines-cron.yml Cron job (MacOS, Linux, Winows) every 6Hrs (#660) 2019-08-13 03:47:28 +05:30
azure-pipelines-ctl-publishing.yml [Internal] CTL: Adds yml automation for daily image build (#2148) 2021-01-25 08:11:12 -08:00
azure-pipelines-encryption-custom.yml [INTERNAL] Pipeline: Adds SBOM generation (#3057) 2022-03-03 19:26:08 +00:00
azure-pipelines-encryption.yml [INTERNAL] Pipeline: Adds SBOM generation (#3057) 2022-03-03 19:26:08 +00:00
azure-pipelines-functional.yml [Internal] Pipelines: Fixes pipeline to not run on documentation (#3425) 2022-08-29 21:14:49 +00:00
azure-pipelines-nightly.yml Internal Gates: Fixes Tests and update pipelines (#2427) 2021-04-27 08:59:52 -07:00
azure-pipelines-official.yml Query: Adds new dependency files from ServiceInterop.dll (#3322) 2022-07-07 09:19:08 -07:00
azure-pipelines.yml [Internal] Pipelines: Fixes pipeline to not run on documentation (#3425) 2022-08-29 21:14:49 +00:00
changelog.md Release: Adds SDK version and changelog for 3.31.2 (#3546) 2022-11-03 13:47:15 -07:00
repo.config
testkey.snk Remove Microsoft.Azure.Direct.MyGet dependency (#760) 2019-09-10 19:57:58 +05:30

README.md

NuGet NuGet Prerelease

Microsoft Azure Cosmos DB .NET SDK Version 3

This client library enables client applications to connect to Azure Cosmos via the SQL API. Azure Cosmos 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

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.