SlideShare ist ein Scribd-Unternehmen logo
1 von 45
The micro-ORM that will
change your life
Davide Mauri, Director of Software Engineering,
Sensoria
Dapper .NET
Please silence
cell phones
Please silence
cell phones
2
Free online webinar
events
Free 1-day local
training events
Local user groups
around the world
Online special
interest user groups
Business analytics
training
Free Online Resources
PASS Blog
White Papers
Session Recordings
Newsletter www.pass.org
Explore everything PASS has to offer
PASS Connector
BA Insights
Get involved
Davide Mauri
Director of Software
Engineering, Sensoria
A DEVELOPER
20 years in development, started with C++,
then VB & Delphi, then C# and now also
Python. Active on GitHub
A DATABASE GUY
15 years spent on High-Performance
Database, Data Warehouse, Business
Intelligence and Business Analytics projects.
Data Platform MVP since 2007
AGILE & AUTOMATION FAN
Fan of Agile Methodology and Automation, I
try to apply them everywhere he can, to
make sure that "people think, machines do".
IoT is where I live and work now, making
sure the above two worlds work well
together
/davidemauri @mauridb
http://www.sensoriafitness.com/
Agenda
• The story so far: DEV, DBA, ORM, MicroORM
• Dapper.NET
• Basic Usage
• Advanced Stuff
• Extensions
• Conclusions
Let’s start with a definition
fric·tion
The resistance that data finds when it moves from the application to the
database or vice-versa
The resistance that one surface or object encounters when moving over
another.
Friction is bad
- It will slow your performance down
- It will make your DBA scream
- It will make your DEV scream
- It will increase solution costs
© http://becauseracecar.net
Impedance Mismatch
Friction exists because of the “Impedance Mismatch”
• Object Oriented Models and Relational Models are different
• Yet they have to co-exists since they are both really good at their job
Friction also gets generated between teams (DBA vs DEV)
• Code First or Database First?
• Stored Procedure or SQL generated on the fly?
What’s your current status?
Beginner Advanced
I really encourage you to share this presentation with your developers.
The story so far…
DEV usually don’t like to write (and in general deal with) databases, and
SQL code especially
• It looks old…wait: it IS old!
• It’s not OO
• It’s complex/strange/illogic
• It’s really not part of my job
So let’s have something to write the SQL code for us so we can just abstract
from it
• It will even make application work with any DB! That’s a strong selling
point to give to my boss!
The story so far…
ORM (Object-Relational-Mapping) to the rescue
• DEVs don’t write the code
• DBAs still can’t put their hands in code but now is the ORM to blame
Everyone is happy from a relationship perspective
The story so far…
Performance still crappy. Really crappy. Let’s move to a NoSQL db then.
• It was cool in that presentation right?
• No more normalization stuff….Ehy is the word “Normalization” that one
I’m seeing in MongoDB docs?
• Nice: no joins! Well uhm…but now we have *a lot* of duplication in our
data.
• But the fact that I can just put and get my class is soooooo cool and
comfortable.
• The DBA will figure out later how the extract data from it and if the data has some logical
meaning or not. Even in which property the data is stored. Damn! Someone created the
InvoiceValue property but we already had the InvoceAmout to be used. Oh well, let’s add an if,
no, better!, let’s create a solution that via IoC that allows us to configure where I have to look
for Invoice amount. Great let’s do that for all the other fields too!
The story so far…
ORM like EF or NHibernate wrote the SQL code on the fly
• No why to change it if at some point you discover it could have been
written so much better
It would be nice if one could just behave like if the SQL code doesn’t exists:
the DBA will write the code for me and I just map it to my OO objects
• Which is boring anyway.
• There is a tool that, given a query in can automatically map the result
into an OO object of mine?
The story so far…
Devs recently come to realize that – an average - they need to use a DB to
excel in their job
• DB is quite cool again. Lock-Free tables, columnar storage, cool uh?
Still writing interacting with the db is boring (which means error prone)
• Create the connection
• Execute the query
• Map the query to OO objects
• Close the connection
• Oh wait, yeah, exception management
The story so far…
DBA they want to be able to Improve, Fix, Cleanup, Tweak SQL code
written by DEVs.
• Because if the db is slow it’s THEIR problem, even if they DIDN’T wrote
that code.
• But actually they don’t really want to touch DEVs code….is so dirty! And
it’s barely comprehensible. And look how he wrote this statement, oh my
gosh, this prevents index to be used, geez! Look: my poor server is just
out of CPU and I/O!
• Phone calls. It’s the customer care complaining that they cannot do their job,
everything is slow
What a MicroORM is?
Just do one simple thing, take data coming from a database query an use it
to populate pre-existing or dynamic objects
• Nothing more and nothing less
• No frills approach: Not identity mapping, no lazy load
• SQL *MUST* be written manually (no LINQ or other intermediate
language like HQL)
• Tries not to introduce friction when accessing and operating on data
One of the most used, proven and well-known is Dapper .NET
https://blogs.msdn.microsoft.com/dotnet/2016/11/09/net-core-data-access/
Why MicroORM?
You are interested in:
GET GREAT PERFORMANCE
REDUCE RESOURCE COSTS
BE IN CONTROL
Dapper .NET
First public release on Apr, 2011
Supports .NET “Classic” and .NET Core
Supports any RDBMS supported by .NET ADO providers: SQL Server, SQL
Lite, PostgreSQL, Oracle, MySQL, Firebird, …
Works as an extensions to IDBConnection interface
Installation via NuGet or dotnet add package
Dapper .NET
High performance Micro-ORM:
• YOU Create POCO classes
• YOU Write SQL
Map SQL results to POCO classes
• Automatically done 
Very Fast!
Where does performances come from?
DynamicMethod
• Inject MSIL directly in the body
of existing code
• Somehow like the “asm” keyword of C/C++
Allows mapping to POCO properties
without Reflection
• Almost no performance impact
• No more boring GetInt32()/GetString()/Get…() code 
Dapper .NET
Full source code available on GitHub
https://github.com/StackExchange/dapper-dot-net
Created and used by Stack Exchange
• Battle Tested! 
• Born here: How I learned to stop worrying and write my own ORM
Support available on GitHub and Stack Overflow:
http://stackoverflow.com/questions/tagged/dapper
The Basics
Dapper .NET
Dapper .NET
Extends the IDBConnection interface
Provides three main methods
• Query
• Execute
• ExecuteScalar
Dapper .NET
The three main methods are implemented in various ways
• To support Async/Await
• To support Single/First/FirstOrDefault
• To support multiple results set
• To support DataReaders
Results can be mapped to
• (Enumerable of) POCO classes
• (Enumerable of) dynamic objects
Parametric Queries
All methods support parametric queries.
Parameters are identified using the “@” symbol:
Parameters can be
• Anonymous Objects
• DynamicParameters Objects
• List (to support then IN clause)
SELECT [Id], [FirstName], [LastName]
FROM dbo.[Users] WHERE Id = @Id
Stored Procedures
Stored procedures can be executed easily
• Set CommandType to StoredProcedure
• Do not specify EXEC[UTE]
• Pass the parameters as shown before
• Return value and Output Parameters can be obtained via
DynamicParameters
• Result can be mapped to (Enumerable of) POCOs or Dynamic Objects just as an
ad-hoc query
The Basics
Demo
Advanced
Features
Dapper .NET
Multiple Execution
Use a IEnumerable parameter to execute the statement for each item.
• Only “Execute” Method supports this feature
var paramList = new List<DynamicParameters>();
paramList.Add(p1)
paramList.Add(p2)
paramList.Add(p3)
var affectedRows = conn.Execute(“<SQL>”, paramList)
Multiple Results
Mapping multiple result set to different object is also supported
“Read” is just like the “Query” method and supports all overloads and
specialized methods (eg: ReadFirst, ReadSingle, AsyncRead…)
using (var qm = conn.QueryMultiple(“SELECT…;SELECT…”))
{
var users = qm.Read<User>();
var companies = qm.Read<Company>();
}
Multiple Mapping
It’s also possible to take data from one row and split it in multiple objects
Table-Valued Parameters
Any IEnumerable or DataTable can be used. (As expected)
Use the extension method .AsTableValuedParameter
Special SQL Server Data Types
All ”special” SQL Server Data Types are supported:
• Geometry
• Geography
• HierarchyID
Just use them as usual
• Reference and Use Microsoft.SqlServer.Types
• Use them with Dapper as any other object
JSON
JSON in SQL Server is “just” text
Dapper deals with it as such, so Serialization and Deserialization must be
done manually
Customizing Interaction with database
There are two way to customize how Dapper will map data to and from
database:
• Mapping: Which property is mapped to column and vice-versa
• Handling: How property’s value is loaded into to database column and
vice-versa
Custom Data Mapping
It is possible to replace default “same name” convention mappings
Define mapping between model and database by creating a
CustomPropertyTypeMap
Make it active via SqlMapper.SetTypeMap
Custom Type Handling
Explicitly states how handling data between model and database should
happen
• Opens up a world of possibilities, to handle even the most complex
scenarios
SqlMapper is the object that behind the scenes does the mapping
• Can be used explicitly: SqlMapper.AddTypeHandler(<TypeHandler>)
Create your own type handler
• Create a class that derives from SqlMapper.TypeHandler
• Implement methods Parse and SetValue
Transactions
Transaction are supported via the usual:
• BeginTransaction
• TransactionScope
Buffered & Unbuffered results
By default the entire result set will be loaded in memory and then returned
to you
• The aim is to stay connected to the database for the smallest amount of
time possible
• Of course this means memory usage
In order to have the results usable as soon as they are streamed from the
database the “unbuffered” option exists
conn.Query("SELECT …;", buffered: false);
Advanced
Features
Demo
Extensions
Dapper .NET
Well-Known Extensions
A Growing Ecosystem! Extend Dapper features. Two main families:
• mainly adding CRUD support (by generating SQL on-the-fly)
• customize mapping db to class
A complete list is here:
• http://dapper-tutorial.net/dapper-contrib-third-party-library
ORM and micro-ORM
Now the question is: Is a MicroORM good for me?
If you need performance, know SQL and want/need to be in control of
everything: MicroORM is the way to go
• And, btw, for me, a (Backend) Developer *must* know SQL!
If you prefer more support with compile-time, object tracking, intellisense,
etc. and don’t want/need to write your own SQL: ORM is ok
A mix of the two is also possible if needed.
Conclusions & Alternatives
Other MicroORM you may want to take a look at
• ORMLite
• PetaPoco
• Massive
• Simple.Data
Session evaluations
Download the GuideBook App
and search: PASS Summit 2017
Follow the QR code link
displayed on session signage
throughout the conference
venue and in the program guide
Your feedback is important and valuable.
Go to passSummit.com
Submit by 5pm Friday, November 10th to win prizes. 3 Ways to Access:
Thank You
Learn more from Speaker Name
info@davidemauri.it@mauridb

Weitere ähnliche Inhalte

Was ist angesagt?

Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data StructureMeghaj Mallick
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Lines and angles Class 9 _CBSE
Lines and angles Class 9 _CBSELines and angles Class 9 _CBSE
Lines and angles Class 9 _CBSESmrithi Jaya
 
Business Intelligence for kids (example project)
Business Intelligence for kids (example project)Business Intelligence for kids (example project)
Business Intelligence for kids (example project)Enrique Benito
 
Why is (a+b)2 = a2+b2+2ab
Why is (a+b)2 = a2+b2+2abWhy is (a+b)2 = a2+b2+2ab
Why is (a+b)2 = a2+b2+2abFreshersSite
 
Hsslive gnukhata-handbook-itschool-converted
Hsslive gnukhata-handbook-itschool-convertedHsslive gnukhata-handbook-itschool-converted
Hsslive gnukhata-handbook-itschool-convertedvazhichal12
 

Was ist angesagt? (12)

Standard data-types-in-py
Standard data-types-in-pyStandard data-types-in-py
Standard data-types-in-py
 
C++ references
C++ referencesC++ references
C++ references
 
asymptotic notation
asymptotic notationasymptotic notation
asymptotic notation
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Math
MathMath
Math
 
Lines and angles Class 9 _CBSE
Lines and angles Class 9 _CBSELines and angles Class 9 _CBSE
Lines and angles Class 9 _CBSE
 
Business Intelligence for kids (example project)
Business Intelligence for kids (example project)Business Intelligence for kids (example project)
Business Intelligence for kids (example project)
 
Priority queues
Priority queuesPriority queues
Priority queues
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
Why is (a+b)2 = a2+b2+2ab
Why is (a+b)2 = a2+b2+2abWhy is (a+b)2 = a2+b2+2ab
Why is (a+b)2 = a2+b2+2ab
 
Hsslive gnukhata-handbook-itschool-converted
Hsslive gnukhata-handbook-itschool-convertedHsslive gnukhata-handbook-itschool-converted
Hsslive gnukhata-handbook-itschool-converted
 

Ähnlich wie Dapper: the microORM that will change your life

What is spatial sql
What is spatial sqlWhat is spatial sql
What is spatial sqlshawty_ds
 
Machine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossMachine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossAndrew Flatters
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Calvin Tan
 
From a student to an apache committer practice of apache io tdb
From a student to an apache committer  practice of apache io tdbFrom a student to an apache committer  practice of apache io tdb
From a student to an apache committer practice of apache io tdbjixuan1989
 
Agile Data: Building Hadoop Analytics Applications
Agile Data: Building Hadoop Analytics ApplicationsAgile Data: Building Hadoop Analytics Applications
Agile Data: Building Hadoop Analytics ApplicationsDataWorks Summit
 
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014The Hive
 
Mapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudMapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudChris Dagdigian
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented developmentrajmundr
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureThomas Jaskula
 
Hofstra University - Overview of Big Data
Hofstra University - Overview of Big DataHofstra University - Overview of Big Data
Hofstra University - Overview of Big Datasarasioux
 
Agile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsAgile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsRussell Jurney
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
 
Comment choisir entre Parse, Heroku et AWS ?
Comment choisir entre Parse, Heroku et AWS ?Comment choisir entre Parse, Heroku et AWS ?
Comment choisir entre Parse, Heroku et AWS ?TheFamily
 
Server’s variations bsw2015
Server’s variations bsw2015Server’s variations bsw2015
Server’s variations bsw2015Laurent Cerveau
 
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)Jernej Kavka (JK)
 
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...Thibaud Desodt
 

Ähnlich wie Dapper: the microORM that will change your life (20)

What is spatial sql
What is spatial sqlWhat is spatial sql
What is spatial sql
 
Machine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossMachine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy Cross
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
 
From a student to an apache committer practice of apache io tdb
From a student to an apache committer  practice of apache io tdbFrom a student to an apache committer  practice of apache io tdb
From a student to an apache committer practice of apache io tdb
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Agile Data: Building Hadoop Analytics Applications
Agile Data: Building Hadoop Analytics ApplicationsAgile Data: Building Hadoop Analytics Applications
Agile Data: Building Hadoop Analytics Applications
 
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
Mapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the CloudMapping Life Science Informatics to the Cloud
Mapping Life Science Informatics to the Cloud
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Domain oriented development
Domain oriented developmentDomain oriented development
Domain oriented development
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 
CQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architectureCQRS recipes or how to cook your architecture
CQRS recipes or how to cook your architecture
 
Hofstra University - Overview of Big Data
Hofstra University - Overview of Big DataHofstra University - Overview of Big Data
Hofstra University - Overview of Big Data
 
Agile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsAgile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics Applications
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Comment choisir entre Parse, Heroku et AWS ?
Comment choisir entre Parse, Heroku et AWS ?Comment choisir entre Parse, Heroku et AWS ?
Comment choisir entre Parse, Heroku et AWS ?
 
Server’s variations bsw2015
Server’s variations bsw2015Server’s variations bsw2015
Server’s variations bsw2015
 
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
From Paper to Power using Azure Form Recognizer (Azure Sydney UG 2020)
 
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...From ddd to DDD : My journey from data-driven development to Domain-Driven De...
From ddd to DDD : My journey from data-driven development to Domain-Driven De...
 

Mehr von Davide Mauri

Azure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartAzure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartDavide Mauri
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
When indexes are not enough
When indexes are not enoughWhen indexes are not enough
When indexes are not enoughDavide Mauri
 
Building a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureBuilding a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureDavide Mauri
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Azure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONAzure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONDavide Mauri
 
SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2Davide Mauri
 
SQL Server 2016 Temporal Tables
SQL Server 2016 Temporal TablesSQL Server 2016 Temporal Tables
SQL Server 2016 Temporal TablesDavide Mauri
 
SQL Server 2016 What's New For Developers
SQL Server 2016  What's New For DevelopersSQL Server 2016  What's New For Developers
SQL Server 2016 What's New For DevelopersDavide Mauri
 
Azure Stream Analytics
Azure Stream AnalyticsAzure Stream Analytics
Azure Stream AnalyticsDavide Mauri
 
Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine LearningDavide Mauri
 
Dashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BIDashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BIDavide Mauri
 
Azure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applicationsAzure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applicationsDavide Mauri
 
Event Hub & Azure Stream Analytics
Event Hub & Azure Stream AnalyticsEvent Hub & Azure Stream Analytics
Event Hub & Azure Stream AnalyticsDavide Mauri
 
SQL Server 2016 JSON
SQL Server 2016 JSONSQL Server 2016 JSON
SQL Server 2016 JSONDavide Mauri
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Real Time Power BI
Real Time Power BIReal Time Power BI
Real Time Power BIDavide Mauri
 
AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)Davide Mauri
 
Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Davide Mauri
 
Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Davide Mauri
 

Mehr von Davide Mauri (20)

Azure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartAzure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstart
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
When indexes are not enough
When indexes are not enoughWhen indexes are not enough
When indexes are not enough
 
Building a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureBuilding a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with Azure
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Azure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONAzure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSON
 
SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2
 
SQL Server 2016 Temporal Tables
SQL Server 2016 Temporal TablesSQL Server 2016 Temporal Tables
SQL Server 2016 Temporal Tables
 
SQL Server 2016 What's New For Developers
SQL Server 2016  What's New For DevelopersSQL Server 2016  What's New For Developers
SQL Server 2016 What's New For Developers
 
Azure Stream Analytics
Azure Stream AnalyticsAzure Stream Analytics
Azure Stream Analytics
 
Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine Learning
 
Dashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BIDashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BI
 
Azure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applicationsAzure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applications
 
Event Hub & Azure Stream Analytics
Event Hub & Azure Stream AnalyticsEvent Hub & Azure Stream Analytics
Event Hub & Azure Stream Analytics
 
SQL Server 2016 JSON
SQL Server 2016 JSONSQL Server 2016 JSON
SQL Server 2016 JSON
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Real Time Power BI
Real Time Power BIReal Time Power BI
Real Time Power BI
 
AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)
 
Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)
 
Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Azure Machine Learning (Italian)
Azure Machine Learning (Italian)
 

Kürzlich hochgeladen

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Kürzlich hochgeladen (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Dapper: the microORM that will change your life

  • 1. The micro-ORM that will change your life Davide Mauri, Director of Software Engineering, Sensoria Dapper .NET
  • 2. Please silence cell phones Please silence cell phones 2
  • 3. Free online webinar events Free 1-day local training events Local user groups around the world Online special interest user groups Business analytics training Free Online Resources PASS Blog White Papers Session Recordings Newsletter www.pass.org Explore everything PASS has to offer PASS Connector BA Insights Get involved
  • 4. Davide Mauri Director of Software Engineering, Sensoria A DEVELOPER 20 years in development, started with C++, then VB & Delphi, then C# and now also Python. Active on GitHub A DATABASE GUY 15 years spent on High-Performance Database, Data Warehouse, Business Intelligence and Business Analytics projects. Data Platform MVP since 2007 AGILE & AUTOMATION FAN Fan of Agile Methodology and Automation, I try to apply them everywhere he can, to make sure that "people think, machines do". IoT is where I live and work now, making sure the above two worlds work well together /davidemauri @mauridb http://www.sensoriafitness.com/
  • 5. Agenda • The story so far: DEV, DBA, ORM, MicroORM • Dapper.NET • Basic Usage • Advanced Stuff • Extensions • Conclusions
  • 6. Let’s start with a definition fric·tion The resistance that data finds when it moves from the application to the database or vice-versa The resistance that one surface or object encounters when moving over another. Friction is bad - It will slow your performance down - It will make your DBA scream - It will make your DEV scream - It will increase solution costs © http://becauseracecar.net
  • 7. Impedance Mismatch Friction exists because of the “Impedance Mismatch” • Object Oriented Models and Relational Models are different • Yet they have to co-exists since they are both really good at their job Friction also gets generated between teams (DBA vs DEV) • Code First or Database First? • Stored Procedure or SQL generated on the fly?
  • 8. What’s your current status? Beginner Advanced I really encourage you to share this presentation with your developers.
  • 9. The story so far… DEV usually don’t like to write (and in general deal with) databases, and SQL code especially • It looks old…wait: it IS old! • It’s not OO • It’s complex/strange/illogic • It’s really not part of my job So let’s have something to write the SQL code for us so we can just abstract from it • It will even make application work with any DB! That’s a strong selling point to give to my boss!
  • 10. The story so far… ORM (Object-Relational-Mapping) to the rescue • DEVs don’t write the code • DBAs still can’t put their hands in code but now is the ORM to blame Everyone is happy from a relationship perspective
  • 11. The story so far… Performance still crappy. Really crappy. Let’s move to a NoSQL db then. • It was cool in that presentation right? • No more normalization stuff….Ehy is the word “Normalization” that one I’m seeing in MongoDB docs? • Nice: no joins! Well uhm…but now we have *a lot* of duplication in our data. • But the fact that I can just put and get my class is soooooo cool and comfortable. • The DBA will figure out later how the extract data from it and if the data has some logical meaning or not. Even in which property the data is stored. Damn! Someone created the InvoiceValue property but we already had the InvoceAmout to be used. Oh well, let’s add an if, no, better!, let’s create a solution that via IoC that allows us to configure where I have to look for Invoice amount. Great let’s do that for all the other fields too!
  • 12. The story so far… ORM like EF or NHibernate wrote the SQL code on the fly • No why to change it if at some point you discover it could have been written so much better It would be nice if one could just behave like if the SQL code doesn’t exists: the DBA will write the code for me and I just map it to my OO objects • Which is boring anyway. • There is a tool that, given a query in can automatically map the result into an OO object of mine?
  • 13. The story so far… Devs recently come to realize that – an average - they need to use a DB to excel in their job • DB is quite cool again. Lock-Free tables, columnar storage, cool uh? Still writing interacting with the db is boring (which means error prone) • Create the connection • Execute the query • Map the query to OO objects • Close the connection • Oh wait, yeah, exception management
  • 14. The story so far… DBA they want to be able to Improve, Fix, Cleanup, Tweak SQL code written by DEVs. • Because if the db is slow it’s THEIR problem, even if they DIDN’T wrote that code. • But actually they don’t really want to touch DEVs code….is so dirty! And it’s barely comprehensible. And look how he wrote this statement, oh my gosh, this prevents index to be used, geez! Look: my poor server is just out of CPU and I/O! • Phone calls. It’s the customer care complaining that they cannot do their job, everything is slow
  • 15. What a MicroORM is? Just do one simple thing, take data coming from a database query an use it to populate pre-existing or dynamic objects • Nothing more and nothing less • No frills approach: Not identity mapping, no lazy load • SQL *MUST* be written manually (no LINQ or other intermediate language like HQL) • Tries not to introduce friction when accessing and operating on data One of the most used, proven and well-known is Dapper .NET https://blogs.msdn.microsoft.com/dotnet/2016/11/09/net-core-data-access/
  • 16. Why MicroORM? You are interested in: GET GREAT PERFORMANCE REDUCE RESOURCE COSTS BE IN CONTROL
  • 17. Dapper .NET First public release on Apr, 2011 Supports .NET “Classic” and .NET Core Supports any RDBMS supported by .NET ADO providers: SQL Server, SQL Lite, PostgreSQL, Oracle, MySQL, Firebird, … Works as an extensions to IDBConnection interface Installation via NuGet or dotnet add package
  • 18. Dapper .NET High performance Micro-ORM: • YOU Create POCO classes • YOU Write SQL Map SQL results to POCO classes • Automatically done  Very Fast!
  • 19. Where does performances come from? DynamicMethod • Inject MSIL directly in the body of existing code • Somehow like the “asm” keyword of C/C++ Allows mapping to POCO properties without Reflection • Almost no performance impact • No more boring GetInt32()/GetString()/Get…() code 
  • 20. Dapper .NET Full source code available on GitHub https://github.com/StackExchange/dapper-dot-net Created and used by Stack Exchange • Battle Tested!  • Born here: How I learned to stop worrying and write my own ORM Support available on GitHub and Stack Overflow: http://stackoverflow.com/questions/tagged/dapper
  • 22. Dapper .NET Extends the IDBConnection interface Provides three main methods • Query • Execute • ExecuteScalar
  • 23. Dapper .NET The three main methods are implemented in various ways • To support Async/Await • To support Single/First/FirstOrDefault • To support multiple results set • To support DataReaders Results can be mapped to • (Enumerable of) POCO classes • (Enumerable of) dynamic objects
  • 24. Parametric Queries All methods support parametric queries. Parameters are identified using the “@” symbol: Parameters can be • Anonymous Objects • DynamicParameters Objects • List (to support then IN clause) SELECT [Id], [FirstName], [LastName] FROM dbo.[Users] WHERE Id = @Id
  • 25. Stored Procedures Stored procedures can be executed easily • Set CommandType to StoredProcedure • Do not specify EXEC[UTE] • Pass the parameters as shown before • Return value and Output Parameters can be obtained via DynamicParameters • Result can be mapped to (Enumerable of) POCOs or Dynamic Objects just as an ad-hoc query
  • 28. Multiple Execution Use a IEnumerable parameter to execute the statement for each item. • Only “Execute” Method supports this feature var paramList = new List<DynamicParameters>(); paramList.Add(p1) paramList.Add(p2) paramList.Add(p3) var affectedRows = conn.Execute(“<SQL>”, paramList)
  • 29. Multiple Results Mapping multiple result set to different object is also supported “Read” is just like the “Query” method and supports all overloads and specialized methods (eg: ReadFirst, ReadSingle, AsyncRead…) using (var qm = conn.QueryMultiple(“SELECT…;SELECT…”)) { var users = qm.Read<User>(); var companies = qm.Read<Company>(); }
  • 30. Multiple Mapping It’s also possible to take data from one row and split it in multiple objects
  • 31. Table-Valued Parameters Any IEnumerable or DataTable can be used. (As expected) Use the extension method .AsTableValuedParameter
  • 32. Special SQL Server Data Types All ”special” SQL Server Data Types are supported: • Geometry • Geography • HierarchyID Just use them as usual • Reference and Use Microsoft.SqlServer.Types • Use them with Dapper as any other object
  • 33. JSON JSON in SQL Server is “just” text Dapper deals with it as such, so Serialization and Deserialization must be done manually
  • 34. Customizing Interaction with database There are two way to customize how Dapper will map data to and from database: • Mapping: Which property is mapped to column and vice-versa • Handling: How property’s value is loaded into to database column and vice-versa
  • 35. Custom Data Mapping It is possible to replace default “same name” convention mappings Define mapping between model and database by creating a CustomPropertyTypeMap Make it active via SqlMapper.SetTypeMap
  • 36. Custom Type Handling Explicitly states how handling data between model and database should happen • Opens up a world of possibilities, to handle even the most complex scenarios SqlMapper is the object that behind the scenes does the mapping • Can be used explicitly: SqlMapper.AddTypeHandler(<TypeHandler>) Create your own type handler • Create a class that derives from SqlMapper.TypeHandler • Implement methods Parse and SetValue
  • 37. Transactions Transaction are supported via the usual: • BeginTransaction • TransactionScope
  • 38. Buffered & Unbuffered results By default the entire result set will be loaded in memory and then returned to you • The aim is to stay connected to the database for the smallest amount of time possible • Of course this means memory usage In order to have the results usable as soon as they are streamed from the database the “unbuffered” option exists conn.Query("SELECT …;", buffered: false);
  • 41. Well-Known Extensions A Growing Ecosystem! Extend Dapper features. Two main families: • mainly adding CRUD support (by generating SQL on-the-fly) • customize mapping db to class A complete list is here: • http://dapper-tutorial.net/dapper-contrib-third-party-library
  • 42. ORM and micro-ORM Now the question is: Is a MicroORM good for me? If you need performance, know SQL and want/need to be in control of everything: MicroORM is the way to go • And, btw, for me, a (Backend) Developer *must* know SQL! If you prefer more support with compile-time, object tracking, intellisense, etc. and don’t want/need to write your own SQL: ORM is ok A mix of the two is also possible if needed.
  • 43. Conclusions & Alternatives Other MicroORM you may want to take a look at • ORMLite • PetaPoco • Massive • Simple.Data
  • 44. Session evaluations Download the GuideBook App and search: PASS Summit 2017 Follow the QR code link displayed on session signage throughout the conference venue and in the program guide Your feedback is important and valuable. Go to passSummit.com Submit by 5pm Friday, November 10th to win prizes. 3 Ways to Access:
  • 45. Thank You Learn more from Speaker Name info@davidemauri.it@mauridb