Leira.CosmosDb
1.0.1
Prefix Reserved
dotnet add package Leira.CosmosDb --version 1.0.1
NuGet\Install-Package Leira.CosmosDb -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Leira.CosmosDb" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Leira.CosmosDb --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Leira.CosmosDb, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Leira.CosmosDb as a Cake Addin #addin nuget:?package=Leira.CosmosDb&version=1.0.1 // Install Leira.CosmosDb as a Cake Tool #tool nuget:?package=Leira.CosmosDb&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Leira.CosomosDb is a library that helps you use CosmosDb in the right way. Usage is simple
To Start, create a class that implments interface Leira.CosmosDb.Abstracts.ICosmosDocument
public class SampleDocument : ICosmosDocument
{
public Guid Id { get; set; }
public Guid PartitionKey { get; set; }
public string Data { get; set; }
}
Using a guid is a good idea as you can always generate these on the fly. This package will force you to use Guid as the id and partitionKey.
var client = new CosmosDbExtendabilityClient("https://{yourCosmosDbDocumentsUrl}:443/", "{Your API Key}");
// To get a cached Container (This will speed up fetching the container object in subsequent calls)
// if the database doesn't exist it will be created with 400 RU/S shared. Overridable by setting databaseSharedTrhouput in the client instance creation. If set to null, each container will have it's own throughput.
// if the container doesn't exist it will be created with 400 RU/S shared. Overridable by setting containerDedicatedThroughput in the client instance creation. if set to a specific number, the container will have it's own dedicated throughput.
var container = await client.GetContainerAsync("yourDatabaseName", "yourContainerName").ConfigureAwait(false);
// Extension Method that uses feed iterator (Doesn't throw 404 exception)
var singleDocument = await container.GetDocumentAsync<cd>(g, g).ConfigureAwait(false);
// Extension Method that uses feed iterator (Doesn't throw 404 exception)
var listOfDocuments = await container.GetDocumentsInPartitionAsync<cd>(g).ConfigureAwait(false);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.Azure.Cosmos (>= 3.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.