Questions tagged [dapper-extensions]

Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Create, Read, Update, Delete) for your POCOs.

Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Create, Read, 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).

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).

Source: tmsmith/Dapper-Extensions

98 questions
0
votes
1 answer

I needed to do Bulk insert with dapper rainbow

I am using the dapper rainbow database.cs extensions, private void insertList(IEnumerable list) { using (SqlConnection conn = new SqlConnection(connectionString)) { var db = myDB.Init(conn, commandTimeout:…
WingMan20-10
  • 3,594
  • 9
  • 31
  • 42
0
votes
1 answer

dapper GetList(predicate) vs Query(sql condition)

In dapper I can get data with Query("sql condition"). and I can do with dapper extensions GetList(predicate) Both return an IEnumerable Which approach should I choose for which situation? As the extensions library is newer it…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
-1
votes
2 answers

Dapper extension insert data into SQL Server

Database table: CREATE TABLE [dbo].[EmployeeDetails] ( [id] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL, [Name] [varchar](max) NULL, [Emailid] [varchar](max) NULL, [department] [varchar](max) NULL, [Salary] [int] NULL, [Profile]…
-1
votes
1 answer

Foreign keys and pivot tables using dapper extensions

I am using dapper extension methods like insert for everything related to the database in a project but I am not able to connect the models to each other. There are 4 tables in the database: category, event, speaker, and eventspeaker (pivot table).…
IsmaelSad
  • 37
  • 8
-1
votes
1 answer

dapper pluralizes table when defined otherwise in ClassMapper

During an insert, the process errors with an invalid name error. Dapper is trying to pluralize the table name. The mapper class is in the same namespace as the model, named after the table and the model lacks any other annotations, a simple POCO. …
Will Lopez
  • 2,089
  • 3
  • 40
  • 64
-1
votes
1 answer

Error when Inserting using SqlMapperExtension Dapper

Currently playing around with Dapper I'm trying to insert values into the db as follows using (var sqlCon = new SqlConnection(Context.ReturnDatabaseConnection())) { sqlCon.Open(); try { var emailExists =…
Code Ratchet
  • 5,758
  • 18
  • 77
  • 141
-1
votes
1 answer

Exception thrown when using DapperExtensions to "GetList"

I have what I think is a very simple use case for DapperExtensions: using (IDbConnection connection = Database.CreateConnection()) { var model = connection.GetList().ToList(); } However, an exception is thrown: Method not found:…
p07r0457
  • 236
  • 2
  • 11
-1
votes
1 answer

Dapperextension mapping functionality

Is there a way with the dapperexstension mapping to map an object to a value (id) when the object is a property of another object. Here is an example. public class Contact { public int Id { get; set; } public string Name { get; set; } …
Magnus Gladh
  • 1,817
  • 4
  • 20
  • 31
1 2 3 4 5 6
7