Dapper.FastCrud
3.3.2
Requires NuGet 3.3 or higher.
dotnet add package Dapper.FastCrud --version 3.3.2
NuGet\Install-Package Dapper.FastCrud -Version 3.3.2
<PackageReference Include="Dapper.FastCrud" Version="3.3.2" />
paket add Dapper.FastCrud --version 3.3.2
#r "nuget: Dapper.FastCrud, 3.3.2"
// Install Dapper.FastCrud as a Cake Addin #addin nuget:?package=Dapper.FastCrud&version=3.3.2 // Install Dapper.FastCrud as a Cake Tool #tool nuget:?package=Dapper.FastCrud&version=3.3.2
You hate verbatim SQL queries with zero type safety for your code but you love the speed? Dapper.FastCrud
is a fast orm built around essential features of the C# 6 / VB 14 that have finally raised the simplicity of raw SQL constructs to acceptable maintenance levels. These features leave no chance to mistypings or problems arising from db entity refactorings.
What to expect when working with Dapper.FastCrud in the DAL?
Type safety, clean code, less prone to errors, more peace of mind, while still being close to the metal. Here's a sample for 3.x:
var queryParams = new
{
FirstName = "John",
Street = "Creek Street"
};
var persons = dbConnection.Find<Person>(statement => statement
.WithAlias("person")
.Include<Address>(join => join
.InnerJoin()
.WithAlias("address"))
.Where($@"
{nameof(Person.FirstName):of person} = {nameof(queryParams.FirstName):P}
AND {nameof(Address.Street):of address} = {nameof(queryParams.Street):P}")
.OrderBy($"{nameof(Person.LastName):of person} DESC")
.Skip(10)
.Top(20)
.WithParameters(queryParams);
Features:
- Support for LocalDb, Ms Sql Server, MySql, SqLite, PostgreSql and SAP/Sybase SQL Anywhere.
- Entities having composite primary keys are supported, however note that the CRUD operations only support UNIQUE primary keys.
- 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 for simple CRUD operations.
- Compatible with component model data annotations.
- Opt-in relationships. As of 3.0, self referenced entities and multiple joins to the same target are also supported via aliases.
- A set of "formattables" are also included, which can be used even if you don't need the CRUD features of this library but you want to take advantage of the DB mappings.
- A generic T4 template for C# is also provided for convenience in the NuGet package Dapper.FastCrud.ModelGenerator.
- The following mapping styles are supported:
- Code first, using model data annotations (preferred)
- Database first (limited to SQL Server/LocalDb)
- Fluent registration for POCO objects
- Semi-POCO using metadata objects
Release Notes
3.3
- Fixed an issue where the SQL formatter was not generating proper SQL when schemas were used.
- Fixed an issue where calling
OrmConfiguration.ClearEntityRegistrations
was not enough to clear the state between switching dialects viaOrmConfiguration.DefaultDialect
. - Schema tests added for the SQL formatter.
- Tests added to cover schemas for the MsSql, PostgreSql and SQLAnywhere dialects.
3.2
- Added support for
DateOnly
andTimeOnly
data types, introduced in .NET6, however provider support isn't all that great across database flavors. Please check this discussion thread for more info. - Dependencies, tests and benchmarks updated.
3.1
- Added support for SQL Anywhere
- Added support for 'rowversion' type columns for the SQL Server dialect.
- Dependencies, tests and benchmarks updated.
3.0
- Added support for .NET Standard 2.1
- Extended support for the MetadataType attribute in .NET Standard 2.1
- Bulk update can now be used with parameters.
- Format specifier ":P" added for SQL parameters.
- Format specifiers extended to support resolution via aliases in JOINs (e.g. "nameof(prop):of alias").
- Methods adjusted for nullable support.
- [Breaking change] Clean separation for the formatter and the sql builder. As a result, the access to the formatter got moved out of the ISqlBuilder and into the Sql static class.
- Extended the functionality of the Sql "formattables", exposed via the Sql static class, to allow for easy access to both the raw resolved names and their SQL ready counterparts.
- Relationships have been reworked:
- [Breaking change] The fluent mapping setup has changed for setting up relationships.
- The limit of 7 entities in a JOIN was removed.
- The main entity and the JOINed entities can now be aliased. It is now recommended to do so when working with multiple entities in a statement for easy targeting in the WHERE clause.
- JOIN support has been extended to the GET and COUNT methods.
- SQL statements no longer require the presence of a relationship preset in the mappings. You can join with whatever you want, using whatever navigation properties you want (or none) and with any ON clause you desire.
- Added support for self referenced entities (via InverseProperty attribute / fluent mappings / directly in the query).
- Added support for one-to-one relationships (via InverseProperty attribute / fluent mappings / directly in the query).
- Added support for multiple references to the same target (via InverseProperty attribute / fluent mappings / directly in the query).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.1
- Dapper (>= 2.1.35)
-
.NETStandard 2.0
- Dapper (>= 2.1.35)
- System.ComponentModel.Annotations (>= 5.0.0)
-
.NETStandard 2.1
- Dapper (>= 2.1.35)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net6.0
- Dapper (>= 2.1.35)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net8.0
- Dapper (>= 2.1.35)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Dapper.FastCrud:
Package | Downloads |
---|---|
CyberEye.Common.Lib
Package chứa các hàm tiện ích và common |
|
Smooth.IoC.Dapper.Repository.UnitOfWork
The package Provides a solution for the Repository and UnitOfWork patterns together with inversition of control. On the project site there are examples of Autofact, Castle.Windsor, Ninject, Simpleinjector, StructureMap, and Unity integration. The IoC framework is not an issue... It is ment to integrate nice and smooth like... The project uses tor its repository work Dapper as ORM and Dapper.FactCRUD for fluentness. But you can use is as a foundation and with any IDbConnection and IDbTransient framework you like. The library gives you the building blocks to: * Create Sessions from the IDbFactory in your methods, IDbFactory should be injected into your class's. As Session extends IDbConnection and will Open on the factory spawning the session and dispose the connection on disposal of the connection. * Your Sessions can create UnitOfWork's. As Session extends IDbConnection and will Open on the factory spawning the session and dispose the connection on disposal of the connection. * If your logic just needs "just a" UnitOfWork with a session that has the same scope, the factory can create it for you. * The IRepository and abstract concrete class should be used on your individual repository classes to provide simple and basic calls. But ofcasue you can add all the queries you want into your Repositories and use the dapper and dapper.FastCRUD (or any other extensions) functionality provided to you. * The repository abstract classes use Dapper.FastCRUD to give you a fluent ORM experience with the most common calls. * This library does not lock you to using dapper and FastCRUD, you can use any library you like that extends IDbConnection and IDbTransation, and still use the IDbFactory, ISession and IUnitOrWork. * Implemented for .net 4..0, .net 4.5.2, .net 4.6.1, .net 4.7.1+, .net 1.6 standard, .net 2.0 standard+. |
|
Tolitech.Modules.Base.Data
Biblioteca base para a camada Data. Esta é uma biblioteca utilizada em todos os projetos Tolitech, inclusive os gerados pela ferramenta Code Generator. Mais informações em http://www.codegenerator.com.br/ |
|
wallet.lib.dapper
add transaction scope demo |
|
Proactive.DataRepository
Proactive data repository NetStandard package. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.3.2 | 33,022 | 6/3/2024 |
3.3.1 | 178 | 6/3/2024 |
3.2.2 | 248 | 5/31/2024 |
3.1.46 | 220,441 | 3/9/2023 |
3.0.46 | 298,274 | 3/2/2022 |
3.0.45 | 4,604 | 2/22/2022 |
2.6.7 | 91,211 | 1/18/2022 |
2.5.0.39 | 1,057,942 | 4/19/2018 |
2.4.1 | 324,297 | 10/27/2016 |
2.4.0 | 8,648 | 9/21/2016 |
2.3.2 | 11,413 | 2/9/2016 |
2.3.0 | 2,940 | 1/2/2016 |
2.2.0 | 2,874 | 12/8/2015 |
2.1.2 | 2,648 | 10/30/2015 |
2.1.0 | 2,687 | 9/18/2015 |
2.0.0 | 3,379 | 6/1/2015 |
1.1.1 | 2,324 | 5/21/2015 |
1.1.0 | 2,435 | 5/21/2015 |
1.0.2 | 3,361 | 5/18/2015 |
1.0.1 | 2,631 | 5/16/2015 |
1.0.0 | 2,365 | 5/16/2015 |