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
2
votes
1 answer

Dapper SetTypeMap Breaks DapperExtension's ClassMapper

In my project I'm using a custom SqlMapper to map my Db columns in dapper, but when I setup Dapper to user my custom type mapper by doing: Dapper.SqlMapper.SetTypeMap(typeof(User), new UserMapper()); DapperExtension is no more able to Map my User…
Daniele Arrighi
  • 139
  • 1
  • 8
2
votes
1 answer

Predicate comparing two fields with DapperExtensions

I am trying to create what seems like a relatively simple predicate statement for Dapper-Extensions in C# after doing a good number of these, but in one case I need to compare two fields rather than a field and a fixed object…
k3davis
  • 985
  • 12
  • 29
2
votes
1 answer

How to Sort data according to Order by clause using DESC order in dapper extensions?

I want to sort data in DESC order. This is my code: var predicate = Predicates.Sort(x => x.name, false); var result = GetList(predicate).ToList(); protected IEnumerable GetList(object predicate, IList sort = null,…
PNG
  • 103
  • 1
  • 8
2
votes
1 answer

DapperExtensions MySQL INSERT set ID

If I have a class: public class Person { public int Id { get; set; } public string Name { get; set; } } And I try to insert this into a corresponding MySQL table using Dapper/DapperExtensions: var person = new Person { Id = 10, Name =…
smerlung
  • 1,459
  • 1
  • 13
  • 32
2
votes
1 answer

Dapper Extension Get & Update returns errors

I tried to play with Dapper Extension & MS Access and succeeded up to certain extent. My code is listed below. All the functions works properly (Insert/Count/GetList/Delete) except Get & Update. I have summarised the code below. If anybody wants I…
RobinAtTech
  • 1,299
  • 3
  • 22
  • 48
2
votes
1 answer

Dapper Extension Ms Access System.Data.OleDb.OleDbException

I just started to use Dapper. Dapper works fine. As a next step when I tried to integrate with Dapper Extension. It generates an exception called System.Data.OleDb.OleDbException "Additional information: Characters found after end of SQL statement."…
RobinAtTech
  • 1,299
  • 3
  • 22
  • 48
2
votes
2 answers

Insert Guid and retrieve value with dapper

I am trying to insert a record into my database and retrieve the GUID it just added in. Let's say if I have a table with 3 columns, GUID, FirstName, LastName. I need to insert a new record and then get back the GUID that was just generated. The…
Bagzli
  • 6,254
  • 17
  • 80
  • 163
2
votes
1 answer

Can you tell why DapperExtension's Update method is failing to execute?

I'm using SQLite, Dapper and DapperExtensions, all the latest via NuGet. Here's my table's schema... CREATE TABLE `LibraryInfo` ( `Id` INTEGER NOT NULL, `Name` TEXT NOT NULL CHECK(length ( Name ) > 0), `Description` TEXT, …
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
2
votes
2 answers

Dapper Contrib Insert MatchNamesWithUnderscores mapper isn’t working

The Dapper.DefaultTypeMap.MatchNamesWithUnderscores isn’t working for inserts. The mapper works fine for the Get<> method. I'm using the follow versions in my ASP.NET Core 1.0 RC2 project together with postgres database. "dependencies": { …
stevo
  • 2,164
  • 4
  • 23
  • 33
2
votes
1 answer

Dapper.net error with SqlMapper.cs

I started a new project using vb.net and micro ORM DAPPER.NET . Over nuGet I integrated the dapper and dapper.simpleCRUD . My problem is appears when i want to execute some CRUD operations i have a problem with SqlMapper.cs .I do not know whay…
user4226899
2
votes
3 answers

Dapper complex mapping Dapper.Extensions Dapper.FluentMap

I have a bit of a problem with my code and getting dapper to play nicely with it. When I say my code it was inherited, so this is not my design. I am trying to replace Entity Framework as the calls to the database are less than efficient so I wanted…
jimplode
  • 3,474
  • 3
  • 24
  • 42
2
votes
1 answer

Create a convention for ids using dapper

I'd like to create a convention to set the column that are named as "Id" to be primary key, I've been looking at the documentacion and so far I've foud ony to do it manually class by class like: with dommel: public class ProductMap :…
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
2
votes
1 answer

Using CustomPropertyTypeMap to map specific properties

I have a couple of classes that need to have one or two properties (out of several dozen) mapped to a column on a table that has a different column name. I don't want to map all of the properties, when only two differ from the column names in the…
Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
2
votes
1 answer

Dapper CRUD with GUID Ids

I'm pretty new to Dapper and Dapper.SimpleCRUD (https://github.com/ericdc1/Dapper.SimpleCRUD) so please excuse if I'm being a bit dense. I have an existing database that uses GUID Ids (primary keys) rather than auto incremented int Ids. It seems…
Mark Chidlow
  • 1,432
  • 2
  • 24
  • 43
1
vote
1 answer

Why DapperExtensions GetById not returning the object?

I'm using DapperExtensions and the framework I'm using is .NET-Core. I have a base repository with the following: public abstract class TableRepository : ITableRepository where T : class { public T GetById(int id) { using…
KTOV
  • 559
  • 3
  • 14
  • 39