BertoSoftware.DapperContext
0.2.0-alpha
See the version list below for details.
dotnet add package BertoSoftware.DapperContext --version 0.2.0-alpha
NuGet\Install-Package BertoSoftware.DapperContext -Version 0.2.0-alpha
<PackageReference Include="BertoSoftware.DapperContext" Version="0.2.0-alpha" />
<PackageVersion Include="BertoSoftware.DapperContext" Version="0.2.0-alpha" />
<PackageReference Include="BertoSoftware.DapperContext" />
paket add BertoSoftware.DapperContext --version 0.2.0-alpha
#r "nuget: BertoSoftware.DapperContext, 0.2.0-alpha"
#:package BertoSoftware.DapperContext@0.2.0-alpha
#addin nuget:?package=BertoSoftware.DapperContext&version=0.2.0-alpha&prerelease
#tool nuget:?package=BertoSoftware.DapperContext&version=0.2.0-alpha&prerelease
DapperContext
A simple collections of functions and method for CRUD operation in Dapper for generic item.
Version
2025-05-16
0.2.0 - Alpha version
- No changes
2025-05-13
0.1.0 - Alpha version
How to use
- Add a reference to the DapperContext project in your project.
- Add a using statement to the DapperContext namespace in your code file.
- Create a new instance of the DapperContext class, passing in your database connection string.
- Use the methods provided by the DapperContext class to perform CRUD operations on your database.
- Dispose of the DapperContext instance when you're done using it.
- Optionally, you can use the DapperContext class to perform other database operations, such as executing raw SQL queries or stored procedures.
Create a model
A simple data model
VB.NET
Imports Dapper.Contrib.Extensions
Namespace Model
<Table("Person")>
Public Class Person
<Key>
Public Property ID As Integer
Public Property Name As String
Public Property Surname As String
Public Property Address As String
End Class
End Namespace
C#
using Dapper.Contrib.Extensions;
namespace Model
{
[Table("Person")]
public partial class Person
{
[Key]
public int ID { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Address { get; set; }
}
}
A simple use might look like this:
VB.NET
Imports System
Module Program
Sub Main(args As String())
'Add new value into Person Table
Using ctx As New DapperContext
Dim person As New Model.Person With {
.Name = "John",
.Surname = "Doe"
.Address = "Street 23"
}
ctx.InsertOrUpdate(person)
End Using
End Sub
End Module
C#
internal static partial class Program
{
public static void Main(string[] args)
{
// Add new value into Person Table
using (var ctx = new DapperContext())
{
var person = new Model.Person()
{
Name = "John",
Surname = "Doe"
Address = "Street 23"
};
ctx.InsertOrUpdate(person);
}
}
}
Dipendencies
- You have to install Dapper.Contrib and assign to a model the [Key] attribute on ID field
Note
- The InsertOrUpdate method works only if the ‘Key’ attribute has been set to a field of type integer.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Dapper (>= 2.1.66)
- Dapper.Contrib (>= 2.0.78)
- Microsoft.Data.SqlClient (>= 6.0.2)
- Microsoft.Extensions.Configuration (>= 9.0.4)
- microsoft.extensions.configuration.Json (>= 9.0.4)
-
net8.0
- Dapper (>= 2.1.66)
- Dapper.Contrib (>= 2.0.78)
- Microsoft.Data.SqlClient (>= 6.0.2)
- Microsoft.Extensions.Configuration (>= 9.0.4)
- microsoft.extensions.configuration.Json (>= 9.0.4)
-
net9.0
- Dapper (>= 2.1.66)
- Dapper.Contrib (>= 2.0.78)
- Microsoft.Data.SqlClient (>= 6.0.2)
- Microsoft.Extensions.Configuration (>= 9.0.4)
- microsoft.extensions.configuration.Json (>= 9.0.4)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on BertoSoftware.DapperContext:
| Package | Downloads |
|---|---|
|
BertoSoftware.DapperAuditContext
A simple collections of functions and method for CRUD operation in Dapper for generic item with an integrated audit system. |
|
|
BertoSoftware.DapperContext.SqlServer
A simple collections of functions and method for CRUD operation in Dapper for generic item |
|
|
BertoSoftware.DapperContext.MySql
A simple collections of functions and method for CRUD operation in Dapper for generic item |
|
|
BertoSoftware.DapperContext.SQLite
A simple collections of functions and method for CRUD operation in Dapper for generic item |
|
|
BertoSoftware.DapperContext.PostgreSQL
A simple collections of functions and method for CRUD operation in Dapper for generic item |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.1.1 | 111 | 2/10/2026 | |
| 1.1.0 | 245 | 2/3/2026 | |
| 1.0.4 | 232 | 1/27/2026 | |
| 1.0.3 | 334 | 10/21/2025 | |
| 1.0.2 | 328 | 10/20/2025 | |
| 1.0.1 | 367 | 6/13/2025 | |
| 1.0.0 | 465 | 6/10/2025 | |
| 0.6.0-rc1 | 402 | 5/29/2025 | |
| 0.5.0-beta | 405 | 5/25/2025 | |
| 0.4.3-beta | 373 | 5/22/2025 | |
| 0.4.2-beta | 372 | 5/21/2025 | |
| 0.4.1-beta | 399 | 5/21/2025 | |
| 0.4.0-beta | 373 | 5/20/2025 | |
| 0.3.2-alpha | 352 | 5/20/2025 | |
| 0.3.1-alpha | 366 | 5/20/2025 | |
| 0.3.0-alpha | 349 | 5/20/2025 | |
| 0.2.1-alpha | 357 | 5/16/2025 | |
| 0.2.0-alpha | 349 | 5/16/2025 | |
| 0.1.0-alpha1 | 389 | 5/13/2025 |
v0.2.0.0-alpha
- No changes