Questions tagged [micro-orm]

Micro-ORM are lean and mean object relational mappers. They tend to have very basic features but perform very well. Perfect example would be Dapper from StackOverflow team.

Some other examples of Micro-ORM are below:

There are some useful extensions to Dapper to do the simple crud operations on the entities. Some of them are below:

Listen to Scott Hanselman, Rob Conery and Sam Saffron discuss The Rise of Micro-ORM on Hanselminutes Podcase episode. It is very informative.

72 questions
27
votes
13 answers

How to generate model from database using Dapper?

I am coming from PetaPoco camp. PetaPoco has a T4 template which generates model from the database. Is anything similar available for Dapper? I installed Dapper using NuGet and added SqlHelper.cs, but I didn't find anything which generates model…
RKh
  • 13,818
  • 46
  • 152
  • 265
16
votes
1 answer

What is the difference between ORM and micro ORM?

Please mention the difference between (big) ORM and micro ORM. What are the advantages of micro ORM over big ORM. For eg. the difference between entity framework ORM and dapper micro ORM.
Brillian
  • 1,411
  • 2
  • 16
  • 23
15
votes
2 answers

Querying into a complex object with Dapper

I have a Customer class with the following properties: public int Id { get; set; } public string Name { get; set; } public int AddressId { get; set; } public Address Address { get; set; } My goal is to write a Dapper query that will use an Inner…
Blake Rivell
  • 13,105
  • 31
  • 115
  • 231
15
votes
2 answers

How to do an insert and update for an object with a navigation property using Dapper.Rainbow (or optionally using Dapper.Contrib)

I started looking into Dapper just recently. I'm testing it out and was able to do basic CRUD and what I meant by basic is that working on a class with this structure: public class Product { public int Id {get;set;} public string Name…
von v.
  • 16,868
  • 4
  • 60
  • 84
12
votes
3 answers

Mapping char(8) to string property with Dapper

I have the following table, abridged: CREATE TABLE [dbo].[TERMINAL] ( [TERM_CODEID] SMALLINT NOT NULL, [TERM_ACTIVE] SMALLINT NOT NULL, [TERM_NAME] VARCHAR (30) NOT NULL, [TERM_SLA] CHAR (8) NOT NULL, …
ProfK
  • 49,207
  • 121
  • 399
  • 775
10
votes
2 answers

Managing connection with non-buffered queries in Dapper

I have recently started using Dapper, everything seems nice and easy but there is one thing that keeps confusing me: Connection Management. As per the documentation: Dapper does not manage your connection's lifecycle, it assumes the connection it…
Ibrahim Najjar
  • 19,178
  • 4
  • 69
  • 95
10
votes
1 answer

PetaPoco - Multiple result set support

My work recently starting using PetaPoco and although fantastic I missed the feature from Dapper which allowed multiple result grids from a single query to be processed into pocos. As a result I wrote my own implementation for PetaPoco - shown below…
Morphed
  • 3,527
  • 2
  • 29
  • 55
9
votes
4 answers

Should dapper use a "using" statement?

I have seen examples where someone is doing: IDbConnection db = new MySqlConnection(conn); var people = db.Query("SELECT * FROM PEOPLE").ToList(); or is the above a bad practice and should all queries be put in using statements like…
xaisoft
  • 3,343
  • 8
  • 44
  • 72
8
votes
1 answer

Why does Azure Database perform better with transactions

We decided to use a micro-orm against an Azure Database. As our business only needs "inserts" and "selects", we decided to suppress all code-managed SqlTransaction (no concurrency issues on data). Then, we noticed that our instance of Azure Database…
6
votes
1 answer

How to insert DbGeography to SQL Server using dapper

I've created the model using System.Data.Entity.Spatial; public class Store { public int Id { get; private set; } public string Name { get; set; } public string Address { get; set; } public DbGeography Location { get; set;…
Lee Gary
  • 2,357
  • 2
  • 22
  • 38
6
votes
3 answers

Async support in ServiceStack and OrmLite

Currently there exists an async branch of ServiceStack which will make it possible to create async services. But to get all benefits of async, all IO bound operations should be async and therefore all database requests should also be async. I am…
5
votes
2 answers

Is there any Dapper like micro ORM for Python?

I know there are multiple ORMs for python, but I like the idea of Dapper - a simple object mapper. I googled but can't find any Dapper like ORM for python. Is there any existing dapper like micro-ORM for python ?
CodeFu
  • 145
  • 1
  • 14
5
votes
1 answer

Query spatial data with dapper

I've found some related questions, but the author gave up and went ahead with using stored procedures to do the 'mapping'. This is actually a continuation question from here Model public class Store { public int Id { get; private set; } …
Lee Gary
  • 2,357
  • 2
  • 22
  • 38
5
votes
4 answers

Dapper: is it possible to customize the type mapping of a specific field of a specific type?

Let's say I have this User class: public class User { public int ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } public…
Amir Abiri
  • 8,847
  • 11
  • 41
  • 57
4
votes
1 answer

Get data using inner join from Dapper

I am working on DB operations on one project and developing WinForms App C# and I am using Dapper to get data out of DB, I am stuck at situation where I need to retrieve data using inner join. Eg. I've two tables Authors and Book as Follow : public…
Infii
  • 91
  • 1
  • 11
1
2 3 4 5