- Видео 22
- Просмотров 330 203
Jono Williams
Австралия
Добавлен 7 май 2011
Dependency Injection Explained
Showcasing what is dependency injection and why it's useful in C# and .NET
⏱ Timestamps
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
00:00 What is dependency injection
00:31 Dependency injection example
03:20 The problem with manual dependency injection
03:40 Dependency injection frameworks
04:57 Transient vs scoped vs singleton
06:56 Using the DI Framework
09:24 Wrapping Up
👨👨👦👦 Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Github: github.com/jonowilliams26
Twitter: jonowilliams26
⏱ Timestamps
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
00:00 What is dependency injection
00:31 Dependency injection example
03:20 The problem with manual dependency injection
03:40 Dependency injection frameworks
04:57 Transient vs scoped vs singleton
06:56 Using the DI Framework
09:24 Wrapping Up
👨👨👦👦 Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Github: github.com/jonowilliams26
Twitter: jonowilliams26
Просмотров: 1 287
Видео
Avoid nesting by not using the "else" keyword in your code
Просмотров 1,5 тыс.7 месяцев назад
Why should you stop using the else keyword in your code? If you avoid using the else keyword and embrace early returns it can help write more readable and less indented code. 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: jonowilliams26 #programming #softwareengineer
Strategy and Factory Pattern, The Best Software Design Pattern Combo
Просмотров 43 тыс.7 месяцев назад
The strategy and factory pattern is the perfect software design combo. 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: jonowilliams26 #programming #softwareengineer
Why you should delete your comments to write better code
Просмотров 3,1 тыс.8 месяцев назад
I think the easiest way to write better code is to remove code comments. It forces you to write clearer and more understandable code, rather that letting the comments explain the code for you. 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: jonowilliams26
Strategy Pattern, The Best Software Design Pattern
Просмотров 79 тыс.8 месяцев назад
The strategy pattern is my favorite software design pattern 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: jonowilliams26
How to structure your .NET / C# API's
Просмотров 13 тыс.8 месяцев назад
This video explains what I think is the best way to structure your .NET / C# API projects. Github Repo: github.com/jonowilliams26/StructuredMinimalApi ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Options to build APIs 01:07 Common Architectures 01:57 The Best Architecture / Project Structure 04:30 Example Project and Repository 08:14 Wrapping Up 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Githu...
Request Validation in .NET / C# Minimal APIs
Просмотров 6 тыс.8 месяцев назад
In this video we cover how to implement request validation in C# / .NET Minimal APIs using FluentValidation and Endpoint Filters ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 - Intro 00:57 - Using FluentValidation 02:16 - Creating an Endpoint Filter 07:22 - Wrapping up 🔗 Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonathanjameswilliams26 Instagram: jonathanwilliams2696 Tw...
STOP using Minimal APIs for Large Projects!
Просмотров 12 тыс.8 месяцев назад
This video explains how you can structure .NET Minimal APIs like controllers. Reddit Post: www.reddit.com/r/dotnet/comments/18chjr8/how_do_you_structure_large_minimal_api_projects/ ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Intro 00:37 Refactoring Controllers to Minimal APIs 05:11 Comparing Controllers to Minimal APIs 06:00 Recap 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/...
.NET Configuration and Appsettings.json EXPLAINED!
Просмотров 2,6 тыс.9 месяцев назад
This video explains how you can use appsettings.json to configure your .NET applications. Enjoy! ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Intro 00:19 Using IConfiguration 01:33 Using IOptions 04:26 Using IOptionsSnapshot 07:02 Using IOptionsMonitor 08:44 Recap 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: jonowilliams26
Common Entity Framework Mistakes
Просмотров 3,6 тыс.9 месяцев назад
This video explains some common mistakes I see people make when using EF Core. Enjoy! ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Intro 00:12 Loading the entire table 01:56 Select only the columns you need 04:02 Avoid the Cartesian Explosion 06:53 Efficient bulk updates and deletes 09:07 Wrapping up 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonowilliams26 Twitter: twitte...
Dependency Injection in C# .NET
Просмотров 15 тыс.3 года назад
This video explains what is dependency injection in c# and .NET / dotnet and why it's useful! Enjoy! ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Intro 00:28 What is Dependency Injection? 01:12 What is Inversion Of Control? 02:14 Lifetimes 03:52 Why is Dependency Injection Useful? 05:15 Wrapping up 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonathanjameswilliams26 Instagra...
MediatR Validation Behavior - Validation In C# Web API
Просмотров 8 тыс.3 года назад
In this video we cover how to implement validation in a .NET Core web api. The following technologies are used: - C# 9 - .NET 5 - MediatR ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 - Intro 01:16 - Coding 14:50 - Wrapping up 🔗 Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Previous Video 1: ruclips.net/video/mdzEKGlH0_Q/видео.html Previous Video 2: ruclips.net/video/ET00fzkPLVU/видео.html Previous Video 3:...
MediatR Caching Behavior - Caching In C# .NET Core Web API Using MediatR
Просмотров 6 тыс.3 года назад
In this video we cover how to implement caching in a .NET Core web api. The following technologies are used: - C# 9 - .NET 5 - MediatR ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 - Intro 00:46 - Coding 04:33 - Wrapping up 🔗 Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Previous Video 1: ruclips.net/video/mdzEKGlH0_Q/видео.html Previous Video 2: ruclips.net/video/ET00fzkPLVU/видео.html MediatR: github.com/...
MediatR Behaviours Explained
Просмотров 5 тыс.3 года назад
In this video we cover how to use CQRS in a .NET Core application. The following technologies are used: - C# 9 - .NET 5 - MediatR ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 - Intro 00:50 - Coding 05:42 - Wrapping up 🔗 Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Previous Video: ruclips.net/video/mdzEKGlH0_Q/видео.html MediatR: github.com/jbogard/MediatR Github Repo: github.com/jonathanjameswilliams26/CQ...
Angular vs React vs Vue in 2021 in 2 MINUTES
Просмотров 21 тыс.3 года назад
Which web framework should you choose in 2021? Lets find out. ⏱ Timestamps ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 Intro 00:13 Measures 00:19 Job Availability 00:42 Resource Availability 01:05 Enjoyment 01:32 Results 🔗 Links ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github Repo: github.com/jonathanjameswilliams26/ConsoleAppDependencyInjection 👨👨👦👦 Social ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Github: github.com/jonathanjames...
One Simple Tip for Cleaner Code In Web APIs
Просмотров 4 тыс.4 года назад
One Simple Tip for Cleaner Code In Web APIs
Dependency Injection In a C# Console Application (.NET Core)
Просмотров 17 тыс.4 года назад
Dependency Injection In a C# Console Application (.NET Core)
Do You Need a Degree to Be a Developer?
Просмотров 6234 года назад
Do You Need a Degree to Be a Developer?
Coding a Web App Using Vue.js, Nuxt.js & Tailwind CSS
Просмотров 11 тыс.4 года назад
Coding a Web App Using Vue.js, Nuxt.js & Tailwind CSS
Building a Windows Service Using C# and .NET Core
Просмотров 29 тыс.4 года назад
Building a Windows Service Using C# and .NET Core
Coding the Backend Of A Web App In One Day!
Просмотров 14 тыс.4 года назад
Coding the Backend Of A Web App In One Day!
This is the best and simplest explanation I've ever had
Minimal api’s are a gimmick. Just. Say. No.
You forgot to remove the summaries in the traditional controller! thats why the minimal api has less lines of code! 🙂
Are there good opportunities for entry level .net angular dev in australia?
Great content. Do you plan to make a video about Clean Code introduced by Bob with Use cases etc. I am curious about creating Domain scope and for example how to resolve problem that your domain code is not async but application is async and how to handle that case. I am pointing to TypeScript and case where domain return just for example string and use cases need to communicate with BE (repository which return async code). Thanks!
Minimal Api is annoying with repetition of injections but Controllers are a little less performant. Maybe a group injection will help minimal api.
wait 1:46 is that how you do switch-case in C# now? I miss C#
Amazing stuff, to the point and very useful indeed!
Glad it was helpful!
your videos are definitely more useful than long&empty chapsas videos. thanks
Thanks, glad you like them!
Great work! awesome examples! Would you mind if I borrow your presentation style and examples for my blog post? I’m covering this topic as well, and I’ll include a link to this video as a reference. Thank you!
Thank you. All good, go for it
@@jonowilliams26 thanks
Thanks for the video bro, extremetely easy to understand even for a somewhat begginner like me
Means that we have to create a new class for a new NotificationType right?
Great example!
Please can you tell me which software you used to create the video?
It's dependency inversion?
Another great bonus is that the code is more unit test friendly and it's easier to mock things up.
This is more like FastEndpoints does, except it uses minimal API directly, less to minimum dependency which is good. I like the way you explain. It should be understandable even for starter.
I think this is definitely a good approach, however if I'm not mistaken it only allows for one type of notification or am I mistaken?
This is how I see it: When you are in a "selection" scenario: Use strategy. When you are in a "choice" scenario: Use Factory
What I love about minimal api's is that you no longer need to make a large file with all logic, you can put each endpoint in it's own file. great if you want to separate on feature level! Or if you want vertical slice architecture. The lads saying that minimal api's aren't for large projects simply haven't tried our minimal api's. It's perfectly able to do what a controller does, it's just a different flavour.
How do you guys version this appsettings.json files? Do you add it to .gitignore?
Simply awesome 🙌……
bruh, i give up lol, idk why I find this shit so complicated
I love using the strategy pattern with higher order functions: no need to create an interface and classes that implement it. Just create function or directly inject anonymous ones👌
Great video: to the point and full of real life stuff while keeping it simple. Awesome. Subscribed!
Amazing explanation!
Thanks for this! I'm just starting a new Minimal API project and I'm going to use this approach as a template. Don't suppose you fancy revisiting this project to demo how to implement versioning (preferably using the Asp.Versioning.Http package to add URL versioning) with Swagger support too do you!? 😁
Buddy u have added value to my life in just 10 mins. No all other RUclipsrs are able to do that.
Glad you found it helpful!
really appreciate your efforts ✅
Thank you! Glad you found it helpful.
People don't know how to organize minimal apis and yet add 151098310315 handlers for mediatr when adding mediatr for EVERY SINGLE PROJECT. Jesus.
Fantastic tut, cannot get any better from here. Thank you for your amazing work!
Glad you found it helpful!
Excellent explanation, great job !
Thank you!
Itt the best way to structure code is based on physical locations of the machines involved in running your app. Maybe your app will only ever need to be 1 app, but maybe it will need to be two apps, one which lives in the DMZ and one that lives behind it. So I always go with at least 2 projects. One project is the app and is barebones, and the other project has almost all of the code. This works well in case you need to have two apps or 3 apps, they can all easily share the same codebase.
Very nice montage but please talk little slower ;)
Thank you. Haha sorry about that. Will try next time!
@@jonowilliams26 just a lil bit tho, overall the pace is nice. Saved me the need to 1.5x
Such a well made video, liked + subbed (if i wasn't already subbed)
Thank you!
Thank you dude 👍🏼
No problem 👍
This is surprisingly common thing to do. I didn't know it was called Strategy. Isn't this what interfaces are about?
Yep, it’s really simple and like you said, it’s common practice
Really great!! Loved this video
Glad you liked it!!
That's too much value in a single video Keep going bud 🎯
Thank you! Appreciate the positive feedback!
This is such a great video, cleared all my confusion on how to match these two patterns in 4 minutes !
Glad it was helpful!
Great video. Keep it up.
Thanks!
At 2: When i create an extension method on the PostEntity and then call Select(post => post.toDto()) does this also only take the proeprties i need or does this take all properties and discards the rest again?
For the cartesian explosion issue I think the best approach is to use json functions to return the exact json that you want (e.g., in Postgres you have json_agg function). This way you only have one query to the database and not only you don't return duplicate data, you also return it in a much better format. If you're using Node.js you can immediately use the returned JSON instead of having to map it into objects in your application layer. Not sure if this is supported by .NET and Entity Framework, though.
Confidently incorrect redditor. Nice explanation. +sub
Thanks for the sub!
First of all nice video! One point we are missing here is not all endpoints use same dependencies. If only some endpoints are using heavy objects then rest of the endpoints performance degrade if we are using controllers. We can avoid that using minimal api.
[FromServices]
Just watched your simple breakdown of the Strategy Pattern and this one. You do have a skill for this. Keep posting, loving this. Subscribed.
Much appreciated!
Very good content! Congratulations. How can I validate a MapGet with query parameters ? The idea is validate allowed (valid) combinations of five parameters included in the query
This is a very simplistic example that gets messy very quickly. The first problem is putting business logic in your Web Api. You've combined the concerns of the web api, use case and domain logic all into the endpoint. The more complex the logic, the bigger your endpoint becomes. The second problem is that data is now a free-for all that allows unrelated data to intermingle. The bigger the application, the bigger the mess. The vertical slicing is good but needs to be carried through with your data. Move the handler out of your endpoint and call a use case that takes over the work of complex business logic.
Sounds like unnecessary abstraction
The extra indirection can be made easier on the reader by hiding details (i.e. is it multi channel, x channel, y channel???). For example, if the multi channel notifier would have been named just Notifier (in a generic sense), we wouldn't have to care about it being multichannel or whatever, or whatever that means, it would just be a notifier, that uses purpose-build notifiers, like email notifier and sms notifier, but we don't care about that, because our notifier can handle all types of notifications so we can use it everywhere, even where previously an sms notifier was used, or an email notifier was used. By hiding implementation details, including the details of what design patterns are used in the code, we can make it easier for other to read the code and understand what's going on without doing too much digging (i.e. jumping through all the layers of indirection).
Great video, Came across this reddit thread and some of the misinformation in the replies got my piss boiling more than it should have tbh - I do primarily blame Microsoft though for coming up with yet another vague name for a product.