Using Dapper with ASP.NET Core Web API
Want to learn more about building APIs and getting a six-figure income? Check out:
►► OUR BOOK: https://code-maze.com/ultimate-aspnetcore-webapi-second-edition/?source=yt
►► OUR BLAZOR WEBASSEMBLY COURSE: https://code-maze.com/blazor-webassembly-course/?source=yt ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
DESCRIPTION:
In this video, we are going to learn how to use Dapper in the ASP.NET Core Web API project. We are going to talk about Dapper overall, how to use different queries and executions, how to execute stored procedures, and how to create multiple queries inside a transaction.
0:00 Introduction
2:24 Dapper Installation
10:23 Dapper Queries
16:45 Parameters with Dapper
19:59 Creating New Records with Dapper
28:24 Update and Delete with Dapper
35:23 Stored Procedures with Dapper
41:23 Multiple Queries and Mappings
51:11 Transactions with Dapper
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
LINKS MENTIONED IN THE VIDEO:
To visit the whole article, mentioned in the video
►► https://code-maze.com/using-dapper-with-asp-net-core-web-api/
The link to the Onion Architecture article:
►► https://code-maze.com/onion-architecture-in-aspnetcore/
The link to the Global Error Handling video:
►► https://www.youtube.com/watch?v=tk1QK71DVtg
For the mentioned videos Handling GET requests:
►► https://www.youtube.com/watch?v=en41o9VqHeI
Handling POST, PUT, and DELETE Requests:
►► https://www.youtube.com/watch?v=y4w9FLyNOR8
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
FOLLOW US ON SOCIAL MEDIA!
►► https://twitter.com/CodeMazeBlog
►► https://www.facebook.com/CodeMazeBlog
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
VIDEO SUMMARY:
Using Dapper with ASP.NET Core Web API
Dapper is Micro ORM - Object Relational mapper, which we can use to communicate with the database in our projects. By using Dapper, we can write SQL statements as we like to do in the SQL Server.
Dapper has great performance because it doesn’t translate queries that we write in .NET to SQL. It is important to know that Dapper is SQL Injection safe because we can use parameterized queries, and that’s something we should always do. One more important thing is that Dapper supports multiple database providers. It extends ADO.NET’s IDbConnection and provides useful extension methods to query our database. Of course, we have to write queries compatible with our database provider.
When we talk about these extension methods, we have to say that Dapper supports both synchronous and asynchronous method executions. In this video, we are going to use the asynchronous version of those methods.
So, let’s learn more about these extension methods. To do that, let’s visit our article…
We can see that Dapper extends the IDbConnection interface with several methods:
Execute, Query, QueryFirst, QueryFirstOrDefault, QuerySingle, QuerySingleOrDefault, and QueryMultiple.
Also, we can see that all of these methods come with the async functionality: ExecuteAsync, QueryAsync, QueryFirstAsync, and so on.
Of course, you can see from the description what each method does, and by looking at that we can see that some of them are pretty similar to the LINQ methods ( First, FirstOrDefault, Single, SingleOrDefault).
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Using Dapper with ASP.NET Core Web API», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.