0% found this document useful (0 votes)
37 views12 pages

Dapper

Uploaded by

jignesh jani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views12 pages

Dapper

Uploaded by

jignesh jani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Dapper

Author : Khushbu
Sihora
Aartronix Innovation Pvt.Ltd 1
What is Dapper ?
Dapper is an open – source Object Relational Mapping(ORM) library for .NET
application. It allows you to map database objects to C# objects.

The library allows developers quickly and easily access data from databases without
the need to write tedious code.

Dapper is known for its performance and simplicity, making it a popular choice
among developers.

With Dapper you can easily perform CRUD Operation on your database. It support
basic Operations such as Select , Insert , Update and Delete .

Aartronix Innovation Pvt.Ltd 2


Object Relational Mapping
O b j e c t - Re l a t i o n a l M a p p i n g ( O R M ) i s a p ro g r a m m i n g t e c h n i q u e t h a t
allows developers to interact with databases using object-oriented
p ro g r a m m i n g l a n g u a g e s . O R M t o o l s m a p o b j e c t s t o re l a t i o n a l
database tables, making it easier to query and manipulate data.

M a p p i n g i s m a p o n e o b j e c t t o a n o t h e r o b j e c t , w h i c h a re t h e s a m e
t y p e a n d d i ff e re n t t y p e .

Dapper allows you to map your database objects to C# objects,


making it easy to work with your data in a familiar format.

Aartronix Innovation Pvt.Ltd 3


Why Use Dapper?
U s i n g D a p p e r c a n s i m p l i f y y o u r d a t a a c c e s s l a y e r b y re d u c i n g t h e
a m o u n t o f c o d e y o u n e e d t o w r i t e . I t a l s o p ro v i d e s b e t t e r
performance than traditional ORMs because it uses raw SQL
queries.

Additionally, Dapper is highly customizable, allowing you to write


your own SQL queries and map them to your objects.

Aartronix Innovation Pvt.Ltd 4


How to Apply Dapper
To a d d D a p p e r i n y o u r S o f t w a re / A p p l i c a t i o n :

• C re a t e D ATA B A S E a n d TA B L E .
• To g e t s t a r t e d w i t h D a p p e r , y o u n e e d t o i n s t a l l t h e D a p p e r N u G e t p a c k a g e a n d
c re a t e a c o n n e c t i o n s t r i n g t o y o u r d a t a b a s e . T h e n , y o u c a n u s e D a p p e r ' s Q u e r y
o r E xe c u t e m e t h o d s t o exe c u t e S Q L q u e r i e s a n d m a p t h e m t o y o u r o b j e c t s .
• I n S o l u t i o n E x p l o re r c re a t e D B Fo l d e r.
• I n D B Fo l d e r c re a t e M O D E L f o l d e r a n d A P P D B . C S c l a s s fi l e .
• A P P D B . C S c l a s s fi l e f o r C o n n e c t i o n S t r i n g ( M S S Q L / M Y S Q L ) .

Aartronix Innovation Pvt.Ltd 5


FOR EXAMPLE :
MYSQL

MSSQL

Aartronix Innovation Pvt.Ltd 6


• I n M O D E L f o l d e r c re a t e a C l a s s fi l e w i t h n a m e o f Ta b l e ( D a t a b a s e ) .
• I n t h i s c l a s s c re a t e a n o t h e r c l a s s a n d d e fi n e c o l u m n o f t a b l e .

Aartronix Innovation Pvt.Ltd 7


QUERIES

Select

Aartronix Innovation Pvt.Ltd 7


Insert

Aartronix Innovation Pvt.Ltd 9


Update

Aartronix Innovation Pvt.Ltd 10


Delete

Aartronix Innovation Pvt.Ltd 11


Thank You

Aartronix Innovation Pvt.Ltd 12

You might also like