.NET Micro ORMs

.NET Micro ORMs will introduce you to what a Micro ORM is and will demonstrate the details of five different .NET Micro ORMs.
Course info
Rating
(278)
Level
Intermediate
Updated
Aug 28, 2013
Duration
4h 8m
Table of contents
Introduction
Dapper
OrmLite
Massive
PetaPoco
Simple.Data
Description
Course info
Rating
(278)
Level
Intermediate
Updated
Aug 28, 2013
Duration
4h 8m
Description

Do you want a data ORM that is simple and lightweight but also is powerful and provides incredible performance? If so, a Micro ORM is for you! This course will provide background for what a Micro ORM is and why you might want to use one. It will then dive into specific details of five .NET Micro ORMs: Dapper, OrmLite, Massive, PetaPoco, and Simple.Data. This demo-heavy course will show the simple elegance of Micro ORMs while providing performance faster than any other "full" ORM available today.

About the author
About the author

Steve is a Program Manager with Microsoft on the Azure Global Engineering team. Prior to joining Microsoft, he was a 7-time Microsoft ASP.NET MVP.

More from the author
ng-bootstrap Playbook
Beginner
2h 48m
Nov 20, 2018
More courses by Steve Michelotti
Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Hi, this is Steve Michelotti from Applied Information Sciences. In this course, we'll cover. NET Micro ORMs. There are two primary goals for this course. First is to give a firm grasp of what a Micro ORM is and why you might want to use one. The second goal is to give an introduction to all the major. NET Micro ORMs that we have at our disposal today. Next, I want to show an agenda of this course. This course is going to have six modules. The first module is going to be an Introduction into Micro ORM. So, overall the course is going to be extremely demo-heavy; we're going to be very code focused; we'll be in Visual Studio most of the time; however, at the beginning I do want to give an introduction that will show a lot of background information, theory, and justification for what a Micro ORM is and why we might want to use one. Then we'll get into the specific frameworks starting with Dapper, which is still considered the king of Micro ORMs. We'll then move on to OrmLite and to PetaPoco. These first three are targeted at the static typing paradigm. Then we'll move on to Massive and Simple. Data. These last two are similar, in that these two are targeted at the dynamic typing paradigm. So if you're a fan of dynamic typing with. NET 4 or above, then these two are definitely the Micro ORMs for you.

Dapper
Hi, this is Steve Michelotti. In this module we're going to explore the Dapper Micro ORM in depth. I'm going to cover Dapper before the other Micro ORMs for a couple of reasons. First, it is currently considered the king of Micro ORMs in terms of performance. Second, based on the number of NuGet downloads, this is the most popular Micro ORM that I'll cover in this course. A quick agenda, in terms of the Key Features, I'm going to start by giving an overview of the Key Features in Dapper. I'm then going to demonstrate the two ways of installing Dapper and getting up and running. Before I start executing queries with Dapper, I'm going to cover the creation of our database to set up the scenario we'll be using throughout this course. I'll also set up some preliminary integration tests, which will guide our development. I'll be using this scenario for the other Micro ORMs as well. Once this setup is complete, I'll be covering various techniques for querying data with Dapper. Finally, I'll cover the create, read, update, and delete operations, as well as show some additional Dapper-specific functionality towards the end of the module. Before we start the module, I want to emphasize the most important aspect, which is to acknowledge the creator of Dapper. Sam Saffron and the StackOverflow team created and maintained this Micro ORM as a result of some performance challenges they were originally having with LINQ to SQL. This library has been instrumental in the emergence of Micro ORMs on the. NET stack.

PetaPoco
Hi, this is Steve Michelotti. In this module we're going to explore the PetaPoco Micro ORM, by Topten Software. PetaPoco was primarily inspired the Massive Micro ORM that we covered in the last module. However, the main difference is that Massive is based purely on dynamic programming, where PetaPoco is based on static typing; though more recently it did add support for dynamic typing as well. Like Massive, PetaPoco consists of only a single C# file, which gets added directly to your project. It's also extremely fast. Let's start out with the agenda of the upcoming module. First, I'm going to start by giving an Overview of the Key Features of PetaPoco. Then, I'll show how to install PetaPoco by adding the appropriate NuGet package. I'll then show how you can do Queries using the same Context Manager database that I've been using in previous modules. I'll go through the entire suite of Create, Read, Update, and Delete operations and show how PetaPoco enables succinct data access code. Finally, I'll show some PetaPoco-Specific Features, such as PetaPoco's T4 Templates, Paging, SQL Builder, and SQL Command Tracking. Before we start, let's acknowledge the Creator of PetaPoco, Brad Robinson of Topten Software. This micro ORM does a really great job of incorporating the best features from other micro ORMs, not only Massive, but features from Dapper and SubSonic. Let's take a quick look at the PetaPoco Homepage, which is right here on toptensoftware. com/petapoco. Right here, you get some background on this micro ORM, as well as lots of good code samples and documentation. So I highly recommend checking out the homepage as soon as you start learning to use PetaPoco.