المدة الزمنية 55:46

Using Dapper with Core Web API

بواسطة Code Maze
27 877 مشاهدة
0
453
تم نشره في 2022/07/08

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: ►► /watch/gtVD17KQ1ktQD For the mentioned videos Handling GET requests: ►► /watch/IeHqV9o14ne1q Handling POST, PUT, and DELETE Requests: ►► /watch/8RONyLF9w4y9N ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 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).

الفئة

عرض المزيد

تعليقات - 34
  • @
    @gulsenkeskin1303منذ 2 سنوات Thank you for your excellent narration 2
  • @
    @abbasshijazi2801منذ 2 سنوات Very nicely explained. Thanks Code Maze 1
  • @
    @hendrasdrtubeقبل 6 أشهر just exactly what I am looking for. Thank you so much.
  • @
    @marioescudero7103قبل 9 أشهر ¡Excelente video! Consulta: cómo se consume esto con Blazor? Gracias
  • @
    @Katha_Samputiمنذ 2 سنوات Very good bro, if possible add content using service layer, repository and calling all this data to controller. 1
  • @
    @user-ob3nq5jk7sقبل 7 أشهر How can i get the querry you pasted on the new created dapper database .so i can use it in my practice before modifying to my own
  • @
    @sametbayraktar5921منذ 2 سنوات hi perfect video can you use sql injection this project ı wanna entegreted
  • @
    @harrisonwell1719قبل 11 أشهر Quick question, what's the point behind using Dynamic Parameter input to ShowCompanyById instead of just passing the id "new{Id=id}" ?
    Thanks
  • @
    @deep87قبل 8 أشهر What if a user just updates a single field, would we still go ahead and update all the columns or there is a different approach for that?
  • @
    @sabicode9689منذ 2 سنوات although i learnt this your site. thanks alot. can you demonstrate how to do authorization on core api using daper 1
  • @
    @softwareengineertrader1562العام الماضي Very nice content, but volume is too low! Is it possible to increase the volume!!
  • @
    @mirrahmathullahimranimran400العام الماضي code maze not able to access the article , pls look into it
  • @
    @RameshKumar-zz8ukالعام الماضي company in null again in web api /api/companies/1 at video time