SDDev.Net.GenericRepository 7.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SDDev.Net.GenericRepository --version 7.0.0
                    
NuGet\Install-Package SDDev.Net.GenericRepository -Version 7.0.0
                    
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="SDDev.Net.GenericRepository" Version="7.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SDDev.Net.GenericRepository" Version="7.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SDDev.Net.GenericRepository" />
                    
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 SDDev.Net.GenericRepository --version 7.0.0
                    
#r "nuget: SDDev.Net.GenericRepository, 7.0.0"
                    
#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 SDDev.Net.GenericRepository@7.0.0
                    
#: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=SDDev.Net.GenericRepository&version=7.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SDDev.Net.GenericRepository&version=7.0.0
                    
Install as a Cake Tool

Overview

This packages implements the Generic Repository pattern for interacting with data in CosmosDB. The goal is to leverage CosmosDB's schemaless capabilities to allow developers to interact only with Plain Old C# Objects (POCOs) and not have to worry about any of the complexity of integrating with CosmosDB. The purpose is to make it easier to deal with 90% of the interaction with CosmosDB. You'll notice that we expose the CosmosDB client out of the repository to allow you to cover the other 10% with your own custom code.

Here is a sample of what using the GenericRepository looks like:

/// A sample POCO that inherits from BaseStorableEntity
var item = new TestObject
{
    Collection = new List<string>
    {
        "TestVal1",
        "TestVal2"
    },
    Number = 5,
    Prop1 = "TestingString",
    ChildObject = new TestObject
    {
        Number = 8,
        Prop1 = "ChildObject"
    }
};

// Inserting the document into CosmosDB
var result = await _testRepo.Upsert(item);

// retrieving a document by id
var retrieved = await _testRepo.Get(result);

// retrieving a document using a predicate (lambda expression)
var doc = await _testRepo.FindOne(x => x.Id == result);

The real power of this library is the ability to dynamically query your data using your strongly typed objects.


Setting up the library

CRUD Operations

Logical vs Physical Delete

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0 493 1/2/2026
9.0.2 1,174 11/23/2025
9.0.1 1,051 11/14/2025
9.0.0 699 10/26/2025
8.0.3 13,685 10/23/2024
8.0.2 1,270 8/23/2024
8.0.1 201 8/23/2024
8.0.0 1,485 6/15/2024
7.0.3 397 6/5/2024
7.0.2 193 6/5/2024
7.0.1 4,691 3/21/2024
7.0.0 419 3/8/2024
5.3.4 271 2/25/2024
5.3.3 2,597 11/27/2023
5.3.2 7,049 8/29/2023
5.3.1 654 8/17/2023
5.3.0 1,286 7/24/2023
5.2.4 312 7/18/2023
5.2.3 255 7/18/2023
5.2.1 1,788 5/20/2023
5.2.0 289 5/19/2023
5.1.4 541 5/1/2023
5.1.3 1,049 4/19/2023
5.1.2 331 4/16/2023
5.1.1 299 4/16/2023
5.1.0 300 4/16/2023
5.0.2 1,032 3/30/2023
5.0.1 374 3/30/2023
5.0.0 2,833 1/11/2023
4.1.3 917 12/13/2022
4.1.2 966 12/11/2022
4.1.1 637 12/3/2022
4.1.0 474 12/2/2022
4.0.8 555 12/1/2022
4.0.7 556 11/11/2022
4.0.6 3,998 7/3/2022
4.0.5 645 6/19/2022
4.0.3 611 6/18/2022
4.0.1 603 6/11/2022
4.0.0 600 6/11/2022
3.0.0 2,018 2/26/2022
2.0.4 901 11/17/2021
2.0.2 998 7/18/2021
2.0.1 632 6/22/2021
2.0.0 533 6/17/2021
1.0.1 1,164 8/24/2018
1.0.0 1,534 5/18/2018