No video

Getting Started with Dapper in .NET

  Рет қаралды 11,103

Amichai Mantinband

Amichai Mantinband

Күн бұрын

All videos in this playlist: • ASP.NET 8 REST API Tut...
In today's video, we'll see how simple it is to get started with the dapper NuGet package and use it to execute SQL queries against our postgres database.
Join us on discord: / amantinband
Get the source code: / amantinband
Support the channel: / amantinband
Connect with me on 'em socials:
Twitter: / amantinband
LinkedIn: / amantinband
GitHub: github.com/ama...
Check out all my courses on DomeTrain:
dometrain.com/...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻

Пікірлер: 46
@fanaccount6600
@fanaccount6600 Ай бұрын
Please add numbers to the title of the videos. i clicked on the playlist link and it's a bit confusing in what order i should watch them
@ahupond
@ahupond Ай бұрын
4:45 Best practice/Performance tip: return a boolean or an Error object instead of throwing an exception. For methods that return valid values, such as GetByIdAsync, you can use OneOf or ErrorOr libraries to return an explicit "not found" instead of using null as an implicit case.
@amantinband
@amantinband Ай бұрын
I would likely recommend yes throwing. In most cases, this should be truly unexpected and should be treated as such.
@jcorrify
@jcorrify 20 күн бұрын
Not sure you realise Amichai is the author of the mentioned ErrorOr Nuget.... I'm confident he knows what he does...
@recaicingoz6785
@recaicingoz6785 Ай бұрын
Thanks for the video but I actually don't want to find myself writing sql queries on the code side. Sometimes I can add a new feature to a class and then I need to change or update the sql query that I defined as dapper query in my repository. btw I know the dapper's power.
@philipfisher8853
@philipfisher8853 Ай бұрын
Noob
@stefano_schmidt
@stefano_schmidt 21 күн бұрын
skill issue )
@Radictor44
@Radictor44 Ай бұрын
Really good video, learnt some things I didn't know here (I'm not a dev), but now thinking of how I can apply this to my own projects. 😃
@mariobrazil3934
@mariobrazil3934 Ай бұрын
Thanks very much Amichai for this video. I'd like you make video how is your vscode settings, add-ons, settings, tips e etc. I notice that your vscode look like vim editor. Again, thank you.
@andrewboyd6090
@andrewboyd6090 Ай бұрын
I haven’t used Dapper in 15 years, it’s barely changed, it certainly isn’t a EF CORE killer, but is worth knowing for the few scenarios it does a better job than EF CORE
@sneer0101
@sneer0101 Ай бұрын
Why would it need to change?
@ashoktandan2372
@ashoktandan2372 Ай бұрын
why scoped for IDBConnectionFactory class?
@boring91
@boring91 2 ай бұрын
Great video as always. One question I have is why did we go with Dapper instead of EF?
@amantinband
@amantinband 2 ай бұрын
Just to mix things up. Both are great options for prod and non-prod apps with different pros and cons
@PatricSjoeoe
@PatricSjoeoe Ай бұрын
EF Core getting better and better, Dapper is now obsolete.
@nilscoussement
@nilscoussement Ай бұрын
@@PatricSjoeoe I did some speed tests last year, and had the same conclusion. However, when working on a bad database, you might still prefer to use raw sql over objects. No significant difference in memory usage or things like that.
@10Totti
@10Totti Ай бұрын
@@PatricSjoeoe Great video but with the recent developments of EF Dapper it is no longer as beneficial as before.
@andihell4208
@andihell4208 Ай бұрын
Hi, Amichai. Thanks for the video. Can you say please is it would be a good idea to change our insert and select queries using string interpolation for naming columns using nameof(Product.Name) for example instead of hardcoding column titles in query string?
@johnnyggun7141
@johnnyggun7141 Ай бұрын
Cool! Shouldn't we reuse the opened DB connection tho?
@vuhoang5903
@vuhoang5903 Ай бұрын
Can we use the generic repository pattern like in EF core or do we have to write distinct queries for every entity?
@cemkaya4448
@cemkaya4448 Ай бұрын
Thanks for the video. In the work environment, do you use postgre SQL or MSSQL? I ask it because in macOS you cannot use the MSSQL. I wonder how do you handle it?
@amantinband
@amantinband Ай бұрын
In this series I'm using postgres (as part of this video: kzfaq.info/get/bejne/gM96mL2Ard6Un6s.html), but mssql can be set up in a similar fasion
@cemkaya4448
@cemkaya4448 Ай бұрын
@@amantinband Thank you!
@gyanookharel7440
@gyanookharel7440 Ай бұрын
Docker?
@tchial0
@tchial0 Ай бұрын
I have been seeing singular names for repositories out there, like "ProductRepository" instead of "ProductsRepository". Which makes more sense?
@elan2199
@elan2199 Ай бұрын
Both
@uuuummm9
@uuuummm9 Ай бұрын
I usually try to not use plural for words that should work as an adjective. But i am not a native speaker.
@harrisonwell1719
@harrisonwell1719 Ай бұрын
I think you should be AddSingleton instead AddScoped, correct me if I'm wrong
@10Totti
@10Totti Ай бұрын
Great video but with the recent developments of EF Dapper it is no longer as beneficial as before.
@amantinband
@amantinband Ай бұрын
Right, although sometimes the choice is a matter of personal preferences and not only performance
@ghevisartor6005
@ghevisartor6005 Ай бұрын
If u want to have an immutable model is hard to do with ef core compared to dapper
@gppsoftware
@gppsoftware Ай бұрын
Sorry, but Dapper went out of fashion 15 years ago. And so did the bad practice of writing non-parameterised raw SQL into code. EF provides a much better way of doing things.
@jcorrify
@jcorrify 20 күн бұрын
The queries are actually parameterized... Dapper or EF is a matter of preference... If you don't like, don't use it but it's still a good option
@gppsoftware
@gppsoftware 20 күн бұрын
@@jcorrify I don't think any of my clients would thank me for imposing 15 year out of date tech debt on them. Good luck with doing that to your clients!
@tekoScott
@tekoScott Ай бұрын
What vscode theme are you using?
@superakaike
@superakaike Ай бұрын
It’s the default theme
@amantinband
@amantinband Ай бұрын
Yep it’s the default
@Siddiskongen
@Siddiskongen Ай бұрын
Why the heck are you using primary constructors and assigning a private field variable? Just use the parameter directly. Thats the point of it
@ddrsdiego
@ddrsdiego 28 күн бұрын
Do better, don't use primary constructors
@Siddiskongen
@Siddiskongen 28 күн бұрын
@@ddrsdiego I have no issue with using primary constructors. I hate mapping DI parameters to corresponding private fields. Only thing they should fix is making the parameters read-only.
@santomy4579
@santomy4579 17 күн бұрын
Can you please elaborate on which point you are referring to by timestamp.
@Siddiskongen
@Siddiskongen 16 күн бұрын
@@santomy4579 E.g 6:39 and 8:10
Global Error Handling in .NET 8 - My Favorite Approach
14:18
Amichai Mantinband
Рет қаралды 10 М.
Migrations Done Right in .NET
11:11
Amichai Mantinband
Рет қаралды 9 М.
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 2,1 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 29 МЛН
天使救了路飞!#天使#小丑#路飞#家庭
00:35
家庭搞笑日记
Рет қаралды 89 МЛН
Getting Started with Event Sourcing in .NET
37:07
Nick Chapsas
Рет қаралды 54 М.
Making LINQ Blazing fast with PLINQ (Parallel LINQ) | .NET & C# Essentials
36:26
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 251 М.
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 135 М.
Exceptions are evil. This is what I do instead.
24:41
Amichai Mantinband
Рет қаралды 19 М.
The Best Way To Organize Your Program.cs In ASP.NET
6:59
Amichai Mantinband
Рет қаралды 15 М.
I Choose THIS Over EF Core - How To Use Dapper in C#
16:09
Dev Leader
Рет қаралды 1,3 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 149 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 146 М.
"Stop Using Async Await in .NET to Save Threads" | Code Cop #018
14:05
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 2,1 МЛН