Cosmonaut.Extensions.Microsoft.DependencyInjection 1.1.0

Microsoft Dependency Injection extension methods

There is a newer version of this package available.
See the version list below for details.
Install-Package Cosmonaut.Extensions.Microsoft.DependencyInjection -Version 1.1.0
dotnet add package Cosmonaut.Extensions.Microsoft.DependencyInjection --version 1.1.0
<PackageReference Include="Cosmonaut.Extensions.Microsoft.DependencyInjection" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cosmonaut.Extensions.Microsoft.DependencyInjection --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Usage

The idea is pretty simple. You can have one CosmoStore per entity (POCO/dtos etc)
This entity will be used to create a collection in the cosmosdb and it will offer all the data access for this object

Registering the CosmosStores in ServiceCollection for DI support

 var cosmosSettings = new CosmosStoreSettings("<<databaseName>>", 
    "<<cosmosUri>>"), 
    "<<authkey>>");
                
serviceCollection.AddCosmosStore<Book>(cosmosSettings);

//or just by using the Action extension

serviceCollection.AddCosmosStore<Book>(options =>
            {
                options.DatabaseName = "<<databaseName>>";
                options.AuthKey = "<<authkey>>";
                options.EndpointUrl = new Uri("<<cosmosUri>>");
            });

//or just initialise the object

ICosmosStore<Book> bookStore = new CosmosStore<Book>(cosmosSettings)

Usage

The idea is pretty simple. You can have one CosmoStore per entity (POCO/dtos etc)
This entity will be used to create a collection in the cosmosdb and it will offer all the data access for this object

Registering the CosmosStores in ServiceCollection for DI support

 var cosmosSettings = new CosmosStoreSettings("<<databaseName>>", 
    "<<cosmosUri>>"), 
    "<<authkey>>");
                
serviceCollection.AddCosmosStore<Book>(cosmosSettings);

//or just by using the Action extension

serviceCollection.AddCosmosStore<Book>(options =>
            {
                options.DatabaseName = "<<databaseName>>";
                options.AuthKey = "<<authkey>>";
                options.EndpointUrl = new Uri("<<cosmosUri>>");
            });

//or just initialise the object

ICosmosStore<Book> bookStore = new CosmosStore<Book>(cosmosSettings)

Release Notes

Please report any issues on Github.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.3.0 36,201 9/28/2018
2.1.0 1,152 9/10/2018
1.1.0 163 9/10/2018