• Home
  • Search Tags
  • About

Dapper.NET

Topics related to Dapper.NET:

Getting started with Dapper.NET

What is Dapper?

Dapper is a micro-ORM for .Net that extends your IDbConnection, simplifying query setup, execution, and result-reading.

How do I get it?

  • github: https://github.com/StackExchange/dapper-dot-net
  • NuGet: https://www.nuget.org/packages/Dapper

Common Tasks

  • Basic Querying
  • Executing Commands

Basic Querying

Executing Commands

Type Handlers

Type Handlers allow database types to be converted to .Net custom types.

Multiple Results

Parameter Syntax Reference

The syntax for expressing parameters varies between RDBMS. All the examples above use SQL Server syntax, i.e. @foo; however, ?foo and :foo should also work fine.

Dynamic Parameters

Handling Nulls

Multimapping

Using Async

Using DbGeography and DbGeometry

Bulk inserts

The WriteToServer and WriteToServerAsync have overloads that accept IDataReader (seen in the examples), DataTable, and DataRow arrays (DataRow[]) as the source of the data for the Bulk Copy.

Temp Tables

Transactions

Content on the page is taken from Stack Overflow Documentation

This site is NOT affiliated with Stack Overflow or any of the contributors. | Privacy Policy | Terms of Service