Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@kodindoyannick532810 ай бұрын
Clean and efficient! Thank you Milan.
@MilanJovanovicTech10 ай бұрын
Any time!
@nettoaoquadrado Жыл бұрын
Milan, I work at a company that heavily relies on Dapper, although in a somewhat anemic domain. While attempting to implement a Rich Domain using DDD's tactical patterns (such as value objects, entities, aggregates, etc.) in some projects, I encountered significant challenges when it came to mapping my aggregates with Dapper. Consequently, I ended up utilizing reflection and protected constructors with signatures that match the projection. It would be incredibly insightful if you could create a video discussing how to effectively leverage Dapper in such scenarios. Your freely shared content on KZbin is greatly appreciated. P.S. I'm thoroughly enjoying your Pragmatic Clean Architecture course!
@MilanJovanovicTech Жыл бұрын
I actually made a video about this a while ago, talking about the Snapshot/Memento pattern 👇 kzbin.info/www/bejne/fpm9ZXeqhLNnZpY P.S. If you get value from the course, it would mean the world to me if you leave a testimonial. ❤️
@abdifatahAnnaati Жыл бұрын
Super simple, clean and efficient..... I haven't messed with Minimal APIs that much(I guess once back about 1+ yr), Thank you for making this. However, I would rather stick with EFCore+Automapper(I hope you will do a video about it too) to avoid raw SQL queries/stuff.
@MilanJovanovicTech Жыл бұрын
I despise Automapper 😁
@abdifatahAnnaati Жыл бұрын
@@MilanJovanovicTech interesting.😊 but curious to know why?? btw I'm trying out Dapper wih different DB Providers(I mostly use Mysql/Postgres), I maybe move an old project that uses direct sql queries with cmd to Dapper(while migrating it to dotnet 7)
@haroldoribeirogomes7103 Жыл бұрын
It would be good make a new video improving this API, spliting it in layers (Repository, Services, ...) and implementing unit tests.
@MilanJovanovicTech Жыл бұрын
Perhaps, but this is enough for a beginner to get started
@mrt7948 Жыл бұрын
Please take it to the next level
@dahlw Жыл бұрын
Didn't know about the option for route groups, thanks for showing us that . Would love to see how you would unit test this.
@MilanJovanovicTech Жыл бұрын
I'll make a video about it :)
@mahmoudalaskalany Жыл бұрын
Great introduction please take it to next level , and show how to get the same featurea in ef core like change tracker , logging , exception handling and more❤
@MilanJovanovicTech Жыл бұрын
Might end up doing it 🤔
@Kingside88 Жыл бұрын
Hi Milan, can you please make a video about "vertical slice architecture" maybe with comparison to clean code archecture and which you would prefer and when?
@MilanJovanovicTech Жыл бұрын
Sure
@Kingside88 Жыл бұрын
@@MilanJovanovicTech thank you!
@MrBodyPower Жыл бұрын
Hey, thanks for the video. Could you please give more details about not to register a SqlConnectionFactory as a singleton service? I dont understand provided example.
@abdifatahAnnaati Жыл бұрын
The .Addsingleton is used coz the connection to the database is established once my application session(at the start) and the re-used as a connection pool.
@MilanJovanovicTech Жыл бұрын
It can be a singleton also - just not if you want to store and reuse the current connection inside.
@tattooineste Жыл бұрын
Superb. Thank you.
@MilanJovanovicTech Жыл бұрын
You're welcome!
@emanuelrodriguez3155 Жыл бұрын
How can we merge Clean Arquitecture and DDD with Dapper instead of EF Core?
@EekChocolate Жыл бұрын
Put all your SQL logic in repositories that get called by either Application layer services or CQRS commands and queries.
@MilanJovanovicTech Жыл бұрын
It'a definitely harder, since there is no UoW. One option is the Snapshot pattern.
@emanuelrodriguez3155 Жыл бұрын
thx i do a little research on that@@MilanJovanovicTech
@andreyz3133 Жыл бұрын
is not it better to inejct IConfiguration inside SqlConnectionFactory and get connection string inside rather than pass it as parameter? or it is better in terms of isolation to make it like this?
@MilanJovanovicTech Жыл бұрын
Sure, that also works
@samuniv987 Жыл бұрын
What would be the difference between creating a controller vs using minimal api if we are moving the code from program.cs?
@MilanJovanovicTech Жыл бұрын
Will you have 200 endpoints in Program.cs? Minimal APIs are more performant
@mahditalebi1770 Жыл бұрын
What do you think of relationships using dapper and having nested objects in C# based on the relationships?
@MilanJovanovicTech Жыл бұрын
Becomes difficult to manage, but it's definitely doable
@lautaroseverino14645 ай бұрын
what's the theme you are using in visual studio? i like it
@MilanJovanovicTech5 ай бұрын
ReSharper + syntax highlighting
@johnormaric3350 Жыл бұрын
Did you use Dapper here both to connect to the database and to execute APIs?
@MilanJovanovicTech Жыл бұрын
I think the answer is yes (from my understanding of your question)
@hussainimca8 ай бұрын
Excellent video. I left .Net probably 8 years ago. wanted to learn quickly .net 8 core as we have a requirement in our company to build application in .Net 8 with Blazer, Syncfusion, MVP framework. Is there a video or tutorial on how to quickly upgrade skills. I do not need to be an expert but decent knowledge is fine. Appreciate your help.
@MilanJovanovicTech8 ай бұрын
I doubt such a video exists
@roshanthapa256 ай бұрын
Hi brother, I am also in the same situation like you, have you found any good resources?
@Tamer_AliАй бұрын
Can we do pagination using Dapper and return pagination object? or using EF Core will be more easier in this point?
@MilanJovanovicTechАй бұрын
Yes, and you can probably do it more efficiently with Dapper
@Website-Content-Creator3 ай бұрын
can you guide me how to create backend received emails like other website platforms ? is there possible to making this thing or not because i dont even find any tutorials like that like gmail recevied other website emails and news also outlook received same to same that type of thing i want make so do you know any thing like that
@MilanJovanovicTech3 ай бұрын
Nope
@Leonidn1972 Жыл бұрын
Thaks a lot. Can I creating a Database with Code First in minimal API project ?
@MilanJovanovicTech Жыл бұрын
Yes
@ahmedbasha9653 Жыл бұрын
I am from Egypt and I have been following the channel for a long time. I would like to thank you for that great explanation, Engineer Milan. I hope that you will give me your social media links to follow all your posts.
@MilanJovanovicTech Жыл бұрын
www.milanjovanovic.tech/#socials
@marshallnyamadzawo8553 Жыл бұрын
Are there no vulnerabilities, like SQL Injection?
@MilanJovanovicTech Жыл бұрын
Not if you parameteriz queries
@ibrahimgirisken8945 Жыл бұрын
Hello, I am creating a project using dapper with onion architecture. Since I was using Dapper, I could not adapt the identity and jwt token packages to the project. Can you help with this?
@MilanJovanovicTech Жыл бұрын
Nope
@unkn0wnrge189 Жыл бұрын
Why did you pick up dapper now instead EF? Are you having issues with speed?
@azad2096 Жыл бұрын
yes, thats the reason Dapper is being preffered, the performance. EF is too slow but more complex
@unkn0wnrge189 Жыл бұрын
@@azad2096 In past I knew EF was bad in performance but the new version I think are fine.
@MilanJovanovicTech Жыл бұрын
No, I want to talk about different options
@sunzhang-d9v Жыл бұрын
Hello, I have a question, the order is created, and the orderItem is created at the same time. Is the creation of the orderItem operated in the orderCommandHandler or what? Or modify the inventory, where should I go to operate? looking forward to your reply
@MilanJovanovicTech Жыл бұрын
I'd say both are updated in the same handler
@sunzhang-d9v Жыл бұрын
thank you🤝@@MilanJovanovicTech
@georgekopadze791 Жыл бұрын
Thank you for great explanation. I am following all of your videos and they are really great. One question though: what’s the point of using minimal apis if we encapsulate all our endpoints in separate class? Is the same if we use controllers. Why do you create CustomerEndpoints instead of CustomersController? Thank you
@MilanJovanovicTech Жыл бұрын
Where else would they live? 😁
@georgekopadze791 Жыл бұрын
@@MilanJovanovicTech fair question :)) in my opinion, minimal api was introduced to reduce responsibilities to API and create micro services. E.g. customers service is containing only endpoints for customers and that’s all. All of the related endpoints i guess would be in program.cs. But anyways, i agree on your choice to organize the code the way you did, i was just wondering if you had more reasons to do so. Thank you for your videos, your progress is remarkable
@kimrobertrozen5609 Жыл бұрын
finally!
@MilanJovanovicTech Жыл бұрын
Got another one coming up soon 😁
@ShivamSingh-gu1hn Жыл бұрын
which theme are you using?
@MilanJovanovicTech Жыл бұрын
Dark + R#
@michaelsodovski Жыл бұрын
but what is the advantage of dapper over entity framework?
@MilanJovanovicTech Жыл бұрын
Simpler to be productive. You just need to write SQL and map to an object. And it's typically more performant since it's doing less work.
@RebelSouls7 ай бұрын
De Milane, imaš li link od git repositorija za ovo??
@MilanJovanovicTech7 ай бұрын
Nemam ovo, ali imam neke primere ovde: github.com/m-jovanovic/
@matthewrossee Жыл бұрын
Hi Milan! How do you approach many to many relationships in DDD with ef core? Most examples in the Internet only show one to one and one to many. Some people use owned relationships. But no-one shows how to do that with many to many relationship.
@MilanJovanovicTech Жыл бұрын
Do you even need such a concept (other than in the DB) in your domain model? Because most problems can be solved without it, and it's simpler
@matthewrossee Жыл бұрын
@@MilanJovanovicTech Do you know any good articles about this? You're right in a sense that I may not need such concept in domain models (still don't know how to do that). However, my domain models are also the models I save in the database (I know that ideally they should be different, but honestly I haven't seen any good example on GitHub). Maybe you could make some video where you try to model some tricky relationships, etc.?
@minaemad-c7y9 ай бұрын
plz explain why singlton not scoped ??
@MilanJovanovicTech9 ай бұрын
Remind me, for which service exactly?
@TrappedInAVoid Жыл бұрын
Really good explanation, however I feel like this Dapper thing wanting literal TSQL strings is really insecure and hellish to maintain in the future
@ryadean Жыл бұрын
You can easily use Stored Procedures with Dapper too if you prefer to not have TSQL littered about in your code.
@TheGravyMonster Жыл бұрын
It's not insecure at all when used properly with parameterisation (Marc Gravell wrote a blog post in 2017 on the subject if you want to read more on that), however I agree that the use of inline SQL is what really turns me off using Dapper.
@MilanJovanovicTech Жыл бұрын
Not if you usr parameters
@health_doc Жыл бұрын
You should also do a video using dapper rainbow
@MilanJovanovicTech Жыл бұрын
Interesting, will explore some more 🤔
@health_doc Жыл бұрын
@MilanJovanovicTech not a lot of documentation, but I love it. The only problem is that it keeps private, the transaction, so you can't combine it with your own queries without turning to reflection. But I don't see you use transactions, so you may be in the clear :-p
@joseronaldo7917 Жыл бұрын
Hi! In your new course, i was reading the curriculum and i have a doubt. In this course, you talk about modular-monolith and integration events? Thanks you a lot for the content!
@MilanJovanovicTech Жыл бұрын
The course is focused on building a monolith, in a modular way. There is only one module, however. I didn't want to overwhelm the student with complexity.
@sunzhang-d9v Жыл бұрын
It would be better to add two conditions to the query, that is, the conditions may not be spliced into SQL
@MilanJovanovicTech Жыл бұрын
What do you mean?
@sunzhang-d9v Жыл бұрын
@@MilanJovanovicTech
@adeni4359 Жыл бұрын
Please do more videos like this where we see you write code from the beginning
@MilanJovanovicTech Жыл бұрын
Will do!
@yogij17 Жыл бұрын
Really informative videos dear Milan! Thank you for your hard work. Can you please tell me if can we use same api controller to cater different countries by using countrycode in url?
@MilanJovanovicTech Жыл бұрын
As a query parameter? Seems doable
@yogij17 Жыл бұрын
@@MilanJovanovicTech Thanks for your reply 🙂👍 What should be the best practice for such scenario.🤔 I dont want long if else statements
@mouradaissani8957 Жыл бұрын
شكرا لك
@MilanJovanovicTech Жыл бұрын
You're welcome
@oneminutecoder7 ай бұрын
Maybe I don't want any improvement. I just want to make a simple application. It's okay if many things are on a single page. I might not need new complications. Sometimes improvements serve no purpose other than adding complexity. It's better to keep it simple unless necessary. If needed, we can deal with improvements. Perhaps the person who comes after me will understand this code better if there are no improvements. Everyone doesn't have to know everything. People have other things to do as well.
@MilanJovanovicTech7 ай бұрын
Sure
@docbrown2045 Жыл бұрын
It's all fun and games until you get enormous tables containing 100+ of columns. Is there a way of deal with them using Dapper without having to write the whole sql?
@MilanJovanovicTech Жыл бұрын
Will you always need 100 columns? There are SPs for something like that, and you clean up the code
@uwejadick4550 Жыл бұрын
Unfortunately it is only half of the way. How do I call the API from my application and how do I retrieve the data or send data to the API?