CustomDapperEntityActions 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package CustomDapperEntityActions --version 1.0.1
NuGet\Install-Package CustomDapperEntityActions -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="CustomDapperEntityActions" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CustomDapperEntityActions" Version="1.0.1" />
<PackageReference Include="CustomDapperEntityActions" />
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 CustomDapperEntityActions --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CustomDapperEntityActions, 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.
#addin nuget:?package=CustomDapperEntityActions&version=1.0.1
#tool nuget:?package=CustomDapperEntityActions&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CustomDapperEntityActions
A .NET package that provides Entity Framework Core-like actions using Dapper, designed for developers whose companies restrict the use of EF Core.
Overview
CustomDapperEntityActions bridges the gap between Dapper's lightweight performance and Entity Framework Core's convenient entity management features. It offers familiar entity action patterns while maintaining Dapper's speed and flexibility.
Features
- EF Core-style entity operations
- Built on top of Dapper for optimal performance
- Compatible with .NET 9.0
- Support for common CRUD operations
Installation
Install via NuGet Package Manager:
How to use
- Define entities
[Table("[schema].[table]")]
public class Plant
{
[Key]
[Column("id")]
public int Id { get; set; }
[Column("description")]
public string? Description { get; set; }
[Column("is_active")]
public bool IsAcive { get; set; }
}
- Make DbContext
public class ApplicationDbContext : IDisposable
{
// if using postgres, sql also possible
private readonly NpgsqlConnection _connection;
private IDbTransaction _transaction;
// The entity we just made
public DapperSet<Plant> Plants { get; }
public ApplicationDbContext(string connectionString)
{
_connection = new NpgsqlConnection(connectionString);
_connection.Open();
_transaction = _connection.BeginTransaction();
// assign them
Plants = new DapperSet<Plant>(_connection, _transaction);
}
public void Commit() => _transaction?.Commit();
public void Rollback() => _transaction?.Rollback();
public void Dispose()
{
_transaction?.Dispose();
_connection?.Dispose();
}
}
- enter in program.cs
bld.Services.AddScoped<ApplicationDbContext>(provider => new ApplicationDbContext(connectionString));
```C#
var insert = await dbContext.Tests.InsertAsync<string>(new Plant
{
Description = "Test",
IsAcive = true
});
var update = await dbContext.Tests.UpdateAsync(new TestLalala
{
Id = 5,
Description = "Luksass",
IsAcive = true
});
var plants = await dbContext.Tests.GetByIdAsync(5);
await dbContext.Tests.DeleteAsync(5);
4. usage
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Dapper (>= 2.1.66)
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 |
---|---|---|
1.0.29 | 390 | 6/11/2025 |
1.0.27 | 263 | 6/10/2025 |
1.0.25 | 261 | 6/10/2025 |
1.0.23 | 263 | 6/10/2025 |
1.0.21 | 117 | 6/6/2025 |
1.0.19 | 104 | 6/6/2025 |
1.0.18 | 223 | 4/30/2025 |
1.0.16 | 140 | 4/30/2025 |
1.0.14 | 152 | 4/29/2025 |
1.0.13 | 114 | 4/25/2025 |
1.0.12-alpha.0.1 | 100 | 4/25/2025 |
1.0.11 | 114 | 4/25/2025 |
1.0.11-alpha.0.16.2.1 | 98 | 4/25/2025 |
1.0.11-alpha.0.16.2 | 94 | 4/25/2025 |
1.0.11-alpha.0.16 | 98 | 4/25/2025 |
1.0.11-alpha.0.15 | 94 | 4/25/2025 |
1.0.11-alpha.0.13 | 99 | 4/25/2025 |
1.0.11-alpha.0.11 | 96 | 4/25/2025 |
1.0.11-alpha.0.9 | 97 | 4/25/2025 |
1.0.11-alpha.0.8 | 133 | 4/24/2025 |
1.0.11-alpha.0.7 | 125 | 4/24/2025 |
1.0.10 | 161 | 4/23/2025 |
1.0.9 | 157 | 4/23/2025 |
1.0.8 | 192 | 4/14/2025 |
1.0.7 | 165 | 4/8/2025 |
1.0.6 | 161 | 4/8/2025 |
1.0.5 | 156 | 4/7/2025 |
1.0.4 | 135 | 4/4/2025 |
1.0.3 | 159 | 4/2/2025 |
1.0.2 | 150 | 4/1/2025 |
1.0.1 | 155 | 4/1/2025 |
1.0.0 | 154 | 4/1/2025 |
1.0.0-alpha.0.29 | 126 | 4/24/2025 |
0.0.0-alpha.0.28 | 135 | 4/23/2025 |