IEvangelist.Azure.CosmosRepository 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package IEvangelist.Azure.CosmosRepository --version 1.0.1
                    
NuGet\Install-Package IEvangelist.Azure.CosmosRepository -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="IEvangelist.Azure.CosmosRepository" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IEvangelist.Azure.CosmosRepository" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="IEvangelist.Azure.CosmosRepository" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IEvangelist.Azure.CosmosRepository --version 1.0.1
                    
#r "nuget: IEvangelist.Azure.CosmosRepository, 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.
#:package IEvangelist.Azure.CosmosRepository@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IEvangelist.Azure.CosmosRepository&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=IEvangelist.Azure.CosmosRepository&version=1.0.1
                    
Install as a Cake Tool

NuGet

Azure Cosmos DB Repository .NET SDK

This package wraps the NuGet: Microsoft.Azure.Cosmos package, exposing a simple dependency-injection enabled IRepository<T> interface. The repository is responsible for all of the create, read, update, and delete (CRUD) operations on objects where T : Item. The Item type adds a single property which is a globally unique identifier defined as:

[JsonProperty("id")]
public string Id { get; set; } = Guid.NewGuid().ToString();

Getting started

  1. Create an Azure Cosmos DB SQL resource.

  2. Obtain the resource connection string from the Keys blade, be sure to get a connection string and not the key - these are different. The connection string is a compound key and endpoint URL.

  3. Call AddCosmosRepository and provide the apps configuration object:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddCosmosRepository(Configuration);
    }
    

    The optional setupAction allows consumers to manually configure the RepositoryOptions object:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddCosmosRepository(Configuration,
            options => 
            {
                options.CosmosConnectionString = "< connection string >";
                options.ContainerId = "data-store";
                options.DatabaseId = "samples";
            });
    }
    
  4. Define your object graph, objects must inherit Item, for example:

    using Microsoft.Azure.CosmosRepository;
    
    public class Person : Item
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    
  5. Ask for an instance of IRepository<TItem>, in this case the TItem is Person:

    using Microsoft.Azure.CosmosRepository;
    
    public class Consumer
    {
        readonly IRepository<Person> _repository;
    
        public Consumer(IRepository<Person> repository) =>
            _respository = repository;
    
        // Use the repo...
    }
    
  6. Perform any of the operations on the _repository instance, create Person records, update them, read them, or delete.

  7. Enjoy!

Product 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on IEvangelist.Azure.CosmosRepository:

Package Downloads
IEvangelist.Azure.CosmosRepository.AspNetCore

This client library enables client applications to connect to Azure Cosmos via a repository pattern around the official Azure Cosmos .NET SDK. Azure Cosmos is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/.

IEvangelist.Azure.CosmosEventSourcing

This client library enables client applications to connect to Azure Cosmos and use it as an event sourcing store.

AIC.Core.Data.CosmosDb

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.2 2,638 6/30/2025
9.0.1 65,110 12/3/2024
9.0.0 5,443 11/21/2024
8.1.7 103,814 7/1/2024
8.1.6 2,794 6/30/2024
8.1.5 44,712 4/10/2024
8.1.4 48,641 3/7/2024
8.1.3 12,277 2/8/2024
8.1.2 91,790 11/29/2023
8.1.1 2,244 11/27/2023
8.1.0 1,118 11/27/2023
8.0.0 2,235 11/20/2023
7.1.0 25,918 9/30/2023
7.0.2 6,453 8/25/2023
7.0.1 52,798 1/22/2023
7.0.0 6,569 1/4/2023
3.7.0 127,897 8/14/2022
3.6.0 22,251 7/23/2022
3.5.5 14,324 6/9/2022
3.5.4 9,875 5/18/2022
3.5.3 34,082 4/7/2022
3.5.2 6,883 3/24/2022
3.5.1 5,788 3/17/2022
3.5.0 3,745 3/14/2022
3.4.1 1,804 3/11/2022
3.4.0 1,750 3/11/2022
3.3.0 1,901 3/10/2022
3.2.0 1,931 3/9/2022
3.1.0 1,914 3/7/2022
3.0.3 3,264 3/5/2022
3.0.2 2,381 3/5/2022
3.0.0 8,266 3/2/2022
2.12.1 45,613 2/2/2022
2.12.0 3,869 2/1/2022
2.12.0-pre1 990 1/21/2022
2.11.0 6,114 1/5/2022
2.10.1 1,953 1/4/2022
2.10.0 925 12/27/2021
2.9.0 869 12/22/2021
2.8.0 3,556 12/15/2021
2.7.1 1,019 12/15/2021
2.7.0 4,013 11/15/2021
2.6.0 3,656 11/3/2021
2.5.3 4,783 11/1/2021
2.5.2 1,670 10/22/2021
2.5.1 1,074 10/18/2021
2.5.0 3,715 9/23/2021
2.3.0 2,230 8/18/2021
2.2.0 1,701 7/20/2021
2.1.9 3,306 6/11/2021
2.1.6 2,184 5/10/2021
2.1.5 3,490 2/11/2021
2.1.4 8,017 2/1/2021
2.1.3 45,157 12/11/2020
2.1.2 1,189 12/2/2020
2.1.1 1,632 11/19/2020
2.1.0 1,938 11/10/2020
2.0.3 1,182 10/23/2020
2.0.2 1,357 10/12/2020
2.0.1 1,062 10/12/2020
2.0.0 1,090 10/9/2020
1.0.5 1,151 10/8/2020
1.0.4 1,385 10/7/2020
1.0.1 1,123 10/2/2020
1.0.0 1,306 10/1/2020
0.0.2-preview 955 9/30/2020
0.0.1-preview 991 9/17/2020