Dapper.FastCrud
2.1.2
dotnet add package Dapper.FastCrud --version 2.1.2
NuGet\Install-Package Dapper.FastCrud -Version 2.1.2
<PackageReference Include="Dapper.FastCrud" Version="2.1.2" />
paket add Dapper.FastCrud --version 2.1.2
#r "nuget: Dapper.FastCrud, 2.1.2"
// Install Dapper.FastCrud as a Cake Addin #addin nuget:?package=Dapper.FastCrud&version=2.1.2 // Install Dapper.FastCrud as a Cake Tool #tool nuget:?package=Dapper.FastCrud&version=2.1.2
The fastest micro-orm type extension for Dapper.
For Dapper constructs in general, it is recommended to use Visual Studio 2015 for features such as nameof and string interpolation, but that's not a requirement.
The package contains .NET 4.5 and 4.6 DLLs, one of which will be installed based on the target framework in your project.
For .NET 4.5, the package will also install the dependency 'StringInterpolationBridge', which contains the polyfills required when using string interpolation with the C# 6 compiler in VS 2015.
Features:
----------
- Support for LocalDb, Ms Sql Server, MySql, SqLite, PostgreSql
- Entities having composite primary keys are supported
- Multiple entity mappings are supported, useful for partial queries in large denormalized tables and data migrations between different database types.
- All the CRUD methods accept a transaction, a command timeout, and a custom entity mapping.
- Fast pre-computed entity queries
- A simple Sql builder with alias support is provided, which is very useful when manual SQL queries are unavoidable.
- A generic T4 template is also provided for convenience in the NuGet package Dapper.FastCrud.ModelGenerator.
Code first entities are also supported which can either be decorated with attributes such as Table, Key and DatabaseGenerated, or can have their mappings programmatically set.
Examples of usage:
-------------------
- using Dapper.FastCrud
- dbConnection.Insert(newEntity);
- dbConnection.Get()
- dbConnection.Get(new Entity() {Id = 10});
- dbConnection.Update(updatedEntity);
- dbConnection.Delete(entity)
- dbConnection.Count()
- dbConnection.Find<Entity>(
whereClause:$"{nameof(Entity.FirstName)}=@FirstNameParam",
orderClause:$"{nameof(Entity.LastName)} DESC",
skipRowsCount:10, limitRowsCount:20,
queryParameters: new {FirstNameParam: "John"});
This is where the power of the C# 6 compiler comes into play, and leaves no chance to mistypings or to problems arising from db entity refactorings.
More details and benchmarks are available on the project site.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6
- Dapper (>= 1.38.0)
-
All Frameworks
- Dapper (>= 1.38.0)
- StringInterpolationBridge (>= 0.9.1)
GitHub repositories
This package is not used by any popular GitHub repositories.
- fixed missing dependency on Dapper