In my previous article I already describe what is dapper, advantages of dapper, why choosing dapper over entity framework core. Also showed full CRUD operation using Dapper in ASP.NET Core Web API and Store Procedure. For detail Click HERE.

In this article I am going to show how to execute multiple queries of different tables at a time using Dapper. Also going to execute multiple store procedures of different tables (object) with parameters at a time using Dapper.

For this example I am going to choose “School” project where I have two Database tables named “Student” and “Teacher”.

Full Video Tutorial :

 

Student’s Table :

Image for post
                                                      Student Database Table

Teacher’s Table :

Image for post
                                                    Teacher Database Table

In this example I am using two store procedures for Student and Teacher.

How to using dapper and calling dapper using Web API (ASP.NET Core) already shown in my previous article. So, here only I am going to show how to execute multiple queries of different tables at a time.

Get all Students and Teachers :

Image for post
Without Async and Await
Image for post
With Async and Await

Get single Object from Student and Teacher Table :

Image for post
Without Async and Await
Image for post
With Async and Await

Insert or Create Operation using Multiple Store Procedures :

Image for post
Without Async and Await
Image for post
With Async and Await

Deleting single item from Different Tables At a time :

Image for post
Without Async and Await
Image for post
With Async and Await

For complete tutorial click here.

Hope this article is helpful. If you like please follow and claps.

Thanks for reading. Happy Coding...