Dapper Extensions alternatives and similar packages
Based on the "ORM" category.
Alternatively, view Dapper Extensions alternatives based on common mentions on social networks and blogs.
-
TypeORM
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms. -
Dapper
DISCONTINUED. Dapper - a simple object mapper for .Net [Moved to: https://github.com/DapperLib/Dapper] -
Entity Framework
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. -
SqlSugar
.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping -
FreeSql
🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, QuestDB orm, MsAccess orm. -
EFCore.BulkExtensions
Entity Framework EF Core efcore Bulk Batch Extensions with BulkCopy in .Net for Insert Update Delete Read (CRUD), Truncate and SaveChanges operations on SQL Server, PostgreSQL, MySQL, SQLite -
Entity Framework 6
This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore. -
SmartSql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics -
NPoco
Simple microORM that maps the results of a query onto a POCO object. Project based on Schotime's branch of PetaPoco -
SQLProvider
A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides. -
MongoDB.Entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management -
MongoDB Repository pattern implementation
DISCONTINUED. Repository abstraction layer on top of Official MongoDB C# driver -
DbExtensions
Data-access framework with a strong focus on query composition, granularity and code aesthetics. -
NReco.Data
Fast DB-independent DAL for .NET Core: abstract queries, SQL commands builder, schema-less data access, POCO mapping (micro-ORM). -
EntityFrameworkCore.SqlServer.SimpleBulks
Very simple .net library that supports bulk insert (retain client populated Ids or return db generated Ids), bulk update, bulk delete, bulk merge and bulk match operations. Lambda Expression is supported. -
Linq.Expression.Optimizer
System.Linq.Expression expressions optimizer. http://thorium.github.io/Linq.Expression.Optimizer -
EntityFramework.DatabaseMigrator
EntityFramework.DatabaseMigrator is a WinForms utility to help manage Entity Framework 6.0+ migrations.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Dapper Extensions or a related project?
README
<!-- -->
Introduction
Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance.
Customized mappings are achieved through ClassMapper.
Important: This library is a separate effort from Dapper.Contrib (a sub-system of the Dapper project). Important: Check our projects list to see the plans for the next releases.
Features
- Zero configuration out of the box.
- Automatic mapping of POCOs for Get, Insert, Update, and Delete operations.
- GetList, Count methods for more advanced scenarios.
- GetPage for returning paged result sets.
- Automatic support for Guid and Integer primary keys (Includes manual support for other key types).
- Pure POCOs through use of ClassMapper (Attribute Free!).
- Customized entity-table mapping through the use of ClassMapper.
- Composite Primary Key support.
- Singular and Pluralized table name support (Singular by default).
- Easy-to-use Predicate System for more advanced scenarios.
- Properly escapes table/column names in generated SQL (Ex: SELECT [FirstName] FROM [Users] WHERE [Users].[UserId] = @UserId_0)
- Unit test coverage (150+ Unit Tests)
Naming Conventions
- POCO names should match the table name in the database. Pluralized table names are supported through the PlurizedAutoClassMapper.
- POCO property names should match each column name in the table.
- By convention, the primary key should be named Id. Using another name is supported through custom mappings.
Installation
For more information, please view our Getting Started guide.
http://nuget.org/List/Packages/DapperExtensions
PM> Install-Package DapperExtensions
Examples
The following examples will use a Person POCO defined as:
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public bool Active { get; set; }
public DateTime DateCreated { get; set; }
}
Get Operation
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
int personId = 1;
Person person = cn.Get<Person>(personId);
cn.Close();
}
Simple Insert Operation
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
Person person = new Person { FirstName = "Foo", LastName = "Bar" };
int id = cn.Insert(person);
cn.Close();
}
Advanced Insert Operation (Composite Key)
public class Car
{
public int ModelId { get; set; }
public int Year { get; set; }
public string Color { get; set; }
}
...
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
Car car = new Car { Color = "Red" };
var multiKey = cn.Insert(car);
cn.Close();
int modelId = multiKey.ModelId;
int year = multiKey.Year;
}
Simple Update Operation
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
int personId = 1;
Person person = cn.Get<Person>(personId);
person.LastName = "Baz";
cn.Update(person);
cn.Close();
}
Simple Delete Operation
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
Person person = cn.Get<Person>(1);
cn.Delete(person);
cn.Close();
}
GetList Operation (with Predicates)
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
var predicate = Predicates.Field<Person>(f => f.Active, Operator.Eq, true);
IEnumerable<Person> list = cn.GetList<Person>(predicate);
cn.Close();
}
Generated SQL
SELECT
[Person].[Id]
, [Person].[FirstName]
, [Person].[LastName]
, [Person].[Active]
, [Person].[DateCreated]
FROM [Person]
WHERE ([Person].[Active] = @Active_0)
More information on predicates can be found in our wiki.
Count Operation (with Predicates)
using (SqlConnection cn = new SqlConnection(_connectionString))
{
cn.Open();
var predicate = Predicates.Field<Person>(f => f.DateCreated, Operator.Lt, DateTime.UtcNow.AddDays(-5));
int count = cn.Count<Person>(predicate);
cn.Close();
}
Generated SQL
SELECT
COUNT(*) Total
FROM [Person]
WHERE ([Person].[DateCreated] < @DateCreated_0)
More information on predicates can be found in our wiki.
License
Copyright 2011 Thad Smith, Page Brooks and contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*Note that all licence references and agreements mentioned in the Dapper Extensions README section above
are relevant to that project's source code only.