SDDev.Net.GenericRepository
7.0.3
dotnet add package SDDev.Net.GenericRepository --version 7.0.3
NuGet\Install-Package SDDev.Net.GenericRepository -Version 7.0.3
<PackageReference Include="SDDev.Net.GenericRepository" Version="7.0.3" />
paket add SDDev.Net.GenericRepository --version 7.0.3
#r "nuget: SDDev.Net.GenericRepository, 7.0.3"
// Install SDDev.Net.GenericRepository as a Cake Addin
#addin nuget:?package=SDDev.Net.GenericRepository&version=7.0.3
// Install SDDev.Net.GenericRepository as a Cake Tool
#tool nuget:?package=SDDev.Net.GenericRepository&version=7.0.3
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 | Versions 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. |
-
net7.0
- AutoMapper (>= 12.0.1)
- AutoMapper.Extensions.Microsoft.DependencyInjection (>= 12.0.1)
- Azure.Search.Documents (>= 11.5.1)
- LINQKit.Core (>= 1.2.4)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Azure.Cosmos (>= 3.35.2)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.Azure (>= 1.6.3)
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- SDDev.Net.GenericRepository.Contracts (>= 7.0.3)
- System.Linq (>= 4.3.0)
- System.Linq.Dynamic.Core (>= 1.3.10)
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 |
---|---|---|
7.0.3 | 29 | 6/5/2024 |
7.0.2 | 34 | 6/5/2024 |
7.0.1 | 2,377 | 3/21/2024 |
7.0.0 | 311 | 3/8/2024 |
5.3.4 | 156 | 2/25/2024 |
5.3.3 | 2,524 | 11/27/2023 |
5.3.2 | 6,941 | 8/29/2023 |
5.3.1 | 555 | 8/17/2023 |
5.3.0 | 1,189 | 7/24/2023 |
5.2.4 | 208 | 7/18/2023 |
5.2.3 | 154 | 7/18/2023 |
5.2.1 | 1,663 | 5/20/2023 |
5.2.0 | 163 | 5/19/2023 |
5.1.4 | 422 | 5/1/2023 |
5.1.3 | 924 | 4/19/2023 |
5.1.2 | 199 | 4/16/2023 |
5.1.1 | 167 | 4/16/2023 |
5.1.0 | 192 | 4/16/2023 |
5.0.2 | 897 | 3/30/2023 |
5.0.1 | 260 | 3/30/2023 |
5.0.0 | 2,667 | 1/11/2023 |
4.1.3 | 789 | 12/13/2022 |
4.1.2 | 840 | 12/11/2022 |
4.1.1 | 498 | 12/3/2022 |
4.1.0 | 336 | 12/2/2022 |
4.0.8 | 419 | 12/1/2022 |
4.0.7 | 419 | 11/11/2022 |
4.0.6 | 3,851 | 7/3/2022 |
4.0.5 | 487 | 6/19/2022 |
4.0.3 | 454 | 6/18/2022 |
4.0.1 | 444 | 6/11/2022 |
4.0.0 | 453 | 6/11/2022 |
3.0.0 | 1,856 | 2/26/2022 |
2.0.4 | 734 | 11/17/2021 |
2.0.2 | 826 | 7/18/2021 |
2.0.1 | 465 | 6/22/2021 |
2.0.0 | 366 | 6/17/2021 |
1.0.1 | 906 | 8/24/2018 |
1.0.0 | 1,053 | 5/18/2018 |