CRUD with Dapper in a .NET 6 Web API using SQL Server 🚀

  Рет қаралды 66,846

Patrick God

Patrick God

Күн бұрын

Пікірлер: 64
@PatrickGod
@PatrickGod 2 жыл бұрын
The first 1,000 people to use the link will get a 1 month free trial of Skillshare: skl.sh/patrickgod06221 🚀
@Artmageddon
@Artmageddon 2 жыл бұрын
I have to say I've been a fan of Dapper and was waiting for something like this for a long time! Keep up the great work!
@neevar1027
@neevar1027 2 жыл бұрын
Thank you Patrick, I was eagerly waiting for this.
@aussieraver7182
@aussieraver7182 Жыл бұрын
One good thing I realised about Dapper over EF core is that when you use it in your portfolio projects for interviews, it proves that you understand at least the basics of SQL as opposed to just using LINQ and treating the SQL Server as a black box.
@SaroopJack
@SaroopJack Жыл бұрын
ive been trying to find a basic crud api with dapper for almost 3 days and finally, you saved me bro.
@PatrickGod
@PatrickGod Жыл бұрын
Glad I could help! Thanks for your feedback! 😊
@AbrahamWilson
@AbrahamWilson 2 жыл бұрын
Thank you so much, for creating this.
@PatrickGod
@PatrickGod 2 жыл бұрын
My pleasure! 😊
@yasminarab1353
@yasminarab1353 2 жыл бұрын
Dapper !!! that what i am waiting for. Thanks you are reading my mind 😊😊
@PatrickGod
@PatrickGod 2 жыл бұрын
You're welcome 😊
@haihai2999
@haihai2999 2 жыл бұрын
This is soo quick and its working.... Thank You.
@oangtuxuhoaqua
@oangtuxuhoaqua 2 жыл бұрын
Thank you Patrick! 😁
@cidmacedo3474
@cidmacedo3474 2 жыл бұрын
Thanks ! Very good !!
@thotchs4116
@thotchs4116 2 жыл бұрын
Thank you patric. luv this episode
@justinosagie9653
@justinosagie9653 2 жыл бұрын
Thank you for the helpful video! You made everything easy to follow understand
@name_nayan
@name_nayan 2 жыл бұрын
Hi Patrick, thanks for this wonderful and informative video. Really appreciate man. ❤
@hasanhuseyin3975
@hasanhuseyin3975 10 ай бұрын
Thank you Patrick, good content.
@jamesscott6864
@jamesscott6864 2 жыл бұрын
Great. Thanks very much!
@Mo-ef9yt
@Mo-ef9yt 2 жыл бұрын
nice walkthrough
@edwintorres2577
@edwintorres2577 2 жыл бұрын
It looks nice with that simple exercise but how about handle CRUD with multiple tables and using Commit and Rollback and Stored Procedures. Thnx a lot Patrick!!!!
@blondisbarrios7454
@blondisbarrios7454 2 жыл бұрын
Thanks!
@Its_danniels
@Its_danniels 2 жыл бұрын
Thanks man, you're save me!!!
@nelsonrivers8546
@nelsonrivers8546 2 жыл бұрын
Thank you. Just an FYI, one issue that came up in the last company I worked at for 5 years was when they decided to go with "Dapper", there were "concurrency issues" that arose. We had to go back and address that. We had to do "special coding" to handle concurrency issues". Can you create an additional video that shows how to handle "concurrency issues" that can arise when using Dapper to do update operations ?
@yanaraldaghestani6305
@yanaraldaghestani6305 2 жыл бұрын
what amazing you are thanks
@tmpmus5985
@tmpmus5985 2 жыл бұрын
Thank you
@PatrickGod
@PatrickGod 2 жыл бұрын
Welcome!
@sundarmanimaran5788
@sundarmanimaran5788 Жыл бұрын
Very useful for me
@PatrickGod
@PatrickGod Жыл бұрын
Glad to hear that!
@fanzfanzilla
@fanzfanzilla Жыл бұрын
Thank you for the video. Do you have a follow up video that shows calling the Dapper API in razor pages simple CRUD application? That will be very helpful to see the whole thing in action.
@guillermomazzari4983
@guillermomazzari4983 Жыл бұрын
Thanks for sharing, but I think it would add a lot if you used interfaces and services, put the connection string on it's own class and injected in the program.cs and create the store procedures in sql, writing sql statements on visual studio is a huge open door for sql injection, you are a good teacher, but it would be much better if you would show complete examples of the tools, just a comment
@DigitalNomadOnFIRE
@DigitalNomadOnFIRE 2 жыл бұрын
Dapper is God
@King-Merlin
@King-Merlin Жыл бұрын
please a full stack video with dapper would be great
@GarethDoherty1985
@GarethDoherty1985 2 жыл бұрын
I used to use Dapper all the time until I discovered IQueryable with EF Core. This one feature made me switch from Dapper straight away. I see a lot of people asking, on the Dapper GitHub, for similar dynamic querying but the point for Dapper is you controller all aspects of the SQL query and its not auto generated the way EF Core does it for you.
@CharlesBurnsPrime
@CharlesBurnsPrime 2 жыл бұрын
Dapper can generate SQL with Dapper.Rainbow or Dapper.Contrib, though not for every database.
@DigitalNomadOnFIRE
@DigitalNomadOnFIRE 2 жыл бұрын
Yes who needs performance or control - EF is fine 🤡 You can do all that stuff with Dapper.Contrib.
@faizanhusain5866
@faizanhusain5866 Жыл бұрын
Can any one suggest? Dapper or EFCore? & Why?
@hhadid9943
@hhadid9943 2 жыл бұрын
When you reached the update saying that's it, I said where where where 😆😆, but then you noticed it was missing 😆😆
@PinasPiliNa999
@PinasPiliNa999 11 ай бұрын
How about a tutorial using Winforms One to many data entry forms
@kamilwolanski2878
@kamilwolanski2878 Жыл бұрын
SQL query to create and insert initial data: CREATE TABLE SuperHeroes ( Id INT PRIMARY KEY IDENTITY(1,1), Name VARCHAR(MAX) NOT NULL, FirstName VARCHAR(MAX) NOT NULL, LastName VARCHAR(MAX) NOT NULL, Place VARCHAR(MAX) NOT NULL ); Insert Into SuperHeroes (Id, Name, FirstName, LastName, Place) Values (1, 'Spider-Man','Peter', 'Parker', 'New York City');
@luis.e.moreno
@luis.e.moreno 2 жыл бұрын
Hey Patrick! Thank you, this video is pretty good! Could you please make one about DTOs? Thanks again!
@jamesscott6864
@jamesscott6864 2 жыл бұрын
Hi Patrick, I believe I can replace the coded sql with a stored procedure call for it to as well work
@bengi8406
@bengi8406 2 жыл бұрын
Hi Patrick great video, I was wondering could've you use string interpolation in GetById endpoint so the query would go like: var hero = await connection.QueryFirstAsync($"select * from testing where id = {heroId}");
@EltonSantos18
@EltonSantos18 Жыл бұрын
I've tried to use the path [HttpGet("{Id}"] instead of [HttpGet("{heroId}")] but it didn't worked. Can someone explain me why, please.
@adriandegenaar5722
@adriandegenaar5722 2 жыл бұрын
Hi Patrick, Great tutorials, they have help me quite a bit. I wanted to know if there will be a wasm server/client side logging tutorial?
@alexandrelimanogueira
@alexandrelimanogueira 2 жыл бұрын
Dapper > Entity
@tommcmeekin1
@tommcmeekin1 2 жыл бұрын
Loved the video Patrick. Could you tell me how easy would it be to swap the sqldb for a sqlite one please?
@PatrickGod
@PatrickGod 2 жыл бұрын
Thanks, Tom! I think you only have to change the connection string. 😊 Hope this helps!
@comroec
@comroec 2 жыл бұрын
how can I use sp?. pls tell me
@ibrahimb6791
@ibrahimb6791 2 жыл бұрын
System.Data.SqlClient isn't a correct one it's discontinued. Microsoft.Data.SqlClient is the most recent packet.
@Trinita75
@Trinita75 2 жыл бұрын
Dapper is much better then Ef !
@name_nayan
@name_nayan 2 жыл бұрын
Agree
@CharlesBurnsPrime
@CharlesBurnsPrime 2 жыл бұрын
Dapper is absolutely great! I have always felt that using a library (Entity Framework) to generate a language (SQL) was a bit of a code smell. Will the library know to use vendor-specific features, like rowids in Oracle or send multiple queries in a single pass, like Dapper does with QueryMultiple? It often doesn't matter with low-usage software, but when it does matter, I find I have to work around the quirks of the library, and often have to bypass it altogether. This is a design decision like any other, but once you get good with Dapper and if you use only 1 or 2 DBMSs most of the time, it's hard to beat both its developer efficiency and transactions-per-second efficiency.
@boniedwin
@boniedwin 2 жыл бұрын
sameee using EF is just adding a whole lot complexity to your program even if you just need a simple read table, also not all EF works flawlessly in every database provider except ms sql our company primarily use oracle ebs, in conjunction with mssql and mariadb, using EF for 3 different DB in one program making it difficult for other dev to maintain and learning EF's concepts of repositories, unit of work, etc is taking a lot of time since i'm also oracle developer i always prefered to write raw query syntax, using EF means a lot of mental overhead for more complex queries. If I want to do queries that have a lot of HAVING conditions or stuff like NOT IN (subquery) you're basically hacking the LINQ syntax until it generates sane SQL statements. It's a leaky abstraction layer. Like your C code of an algorithm looks like an efficient solution but you need to completely rewrite it because the compiler turns the assembler output into a mess.
@pgnutz
@pgnutz 2 жыл бұрын
How can I download these sources ?
@PatrickGod
@PatrickGod 2 жыл бұрын
Here's the repository: github.com/patrickgod/DapperCrudTutorial Enjoy!
@pgnutz
@pgnutz 2 жыл бұрын
@@PatrickGod thanks! Congratulations for the videos.
@daniel_klement_photography
@daniel_klement_photography 2 жыл бұрын
This is great, I already use this method with MS SQL and Entity Framework Core but what I miss, can you please make some tutorial what is thd best way with authorization user from Blazor (Server) and API like this? I have some method done but I am not sure if it is 100% correct
@skylycan007
@skylycan007 Жыл бұрын
i still follow you even you didnt configure VS to use _config by default when creating a ctor :D
@PatrickGod
@PatrickGod Жыл бұрын
Thanks! 😅
@qaisahmad7896
@qaisahmad7896 2 жыл бұрын
hi plz create crud with CQRS and Mediator
@galaxy1066
@galaxy1066 2 жыл бұрын
I dont't believe to dapper about security... nevertheless thnx patrick
@CharlesBurnsPrime
@CharlesBurnsPrime 2 жыл бұрын
What? Dapper is used by some of the largest corporations and most notable software projects. It was written by StackOverflow.com. Additionally, it has nothing to do with security other than that it makes SQL parameterization easier, which eliminates a common security hole owned by database programming beginners.
@boniedwin
@boniedwin 2 жыл бұрын
dapper is an helper for object mapping nothing related with security if you talking about sql injection, then you should always use parameters NEVER write your sql syntax like this string sql = "select * from user where username = '" + user_name + "'";
@chessgamesonline5867
@chessgamesonline5867 2 жыл бұрын
so silly video, u cant delete superhero. because its superhero.
Building a Dapper CRUD API From Scratch In .NET 7 - For Beginners
22:50
Milan Jovanović
Рет қаралды 30 М.
C# Data Access: Complex Objects with Dapper
28:09
IAmTimCorey
Рет қаралды 32 М.
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
Getting Started with Dapper in .NET
23:42
Nick Chapsas
Рет қаралды 25 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 222 М.
The standard library now has all you need for advanced routing in Go.
13:52
Почему я не использую Entity Framework
30:19
Програмысли Влог
Рет қаралды 10 М.
Getting Started with Dapper in .NET
11:29
Amichai Mantinband
Рет қаралды 14 М.
What does larger scale software development look like?
24:15
Web Dev Cody
Рет қаралды 1,4 МЛН
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 104 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 80 М.