Jono Williams
Jono Williams
  • Видео 22
  • Просмотров 330 203
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
Просмотров: 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)
CQRS using C# and MediatR
Просмотров 33 тыс.4 года назад
CQRS using C# and MediatR
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!

Комментарии

  • @michaelotu9723
    @michaelotu9723 10 часов назад

    This is the best and simplest explanation I've ever had

  • @mthithers
    @mthithers День назад

    Minimal api’s are a gimmick. Just. Say. No.

  • @arefdehghanian3454
    @arefdehghanian3454 3 дня назад

    You forgot to remove the summaries in the traditional controller! thats why the minimal api has less lines of code! 🙂

  • @omjagtap-g6u
    @omjagtap-g6u 6 дней назад

    Are there good opportunities for entry level .net angular dev in australia?

  • @ralph8529
    @ralph8529 7 дней назад

    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!

  • @okcharles7
    @okcharles7 9 дней назад

    Minimal Api is annoying with repetition of injections but Controllers are a little less performant. Maybe a group injection will help minimal api.

  • @ardptr
    @ardptr 10 дней назад

    wait 1:46 is that how you do switch-case in C# now? I miss C#

  • @EnriqueMartinezInter
    @EnriqueMartinezInter 15 дней назад

    Amazing stuff, to the point and very useful indeed!

  • @forgeteverythingelse
    @forgeteverythingelse 17 дней назад

    your videos are definitely more useful than long&empty chapsas videos. thanks

  • @azabroflovski
    @azabroflovski 23 дня назад

    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!

  • @yourlocalhuman3526
    @yourlocalhuman3526 29 дней назад

    Thanks for the video bro, extremetely easy to understand even for a somewhat begginner like me

  • @rauljerilara
    @rauljerilara 29 дней назад

    Means that we have to create a new class for a new NotificationType right?

  • @Mihai-LucianOprea
    @Mihai-LucianOprea 29 дней назад

    Great example!

  • @tayyabshaikh8129
    @tayyabshaikh8129 29 дней назад

    Please can you tell me which software you used to create the video?

  • @xthenuwara
    @xthenuwara Месяц назад

    It's dependency inversion?

  • @DrayHav
    @DrayHav Месяц назад

    Another great bonus is that the code is more unit test friendly and it's easier to mock things up.

  • @fakhrulhilal
    @fakhrulhilal Месяц назад

    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.

  • @ReeceEngle4
    @ReeceEngle4 Месяц назад

    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?

  • @humayunmailbox
    @humayunmailbox Месяц назад

    This is how I see it: When you are in a "selection" scenario: Use strategy. When you are in a "choice" scenario: Use Factory

  • @smnb6652
    @smnb6652 Месяц назад

    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.

  • @PetrUtkin
    @PetrUtkin Месяц назад

    How do you guys version this appsettings.json files? Do you add it to .gitignore?

  • @AjayYadav-uf8vq
    @AjayYadav-uf8vq Месяц назад

    Simply awesome 🙌……

  • @salah1x
    @salah1x Месяц назад

    bruh, i give up lol, idk why I find this shit so complicated

  • @fabricehategekimana5350
    @fabricehategekimana5350 2 месяца назад

    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👌

  • @pere5854
    @pere5854 2 месяца назад

    Great video: to the point and full of real life stuff while keeping it simple. Awesome. Subscribed!

  • @tle-x
    @tle-x 2 месяца назад

    Amazing explanation!

  • @moto_matt
    @moto_matt 2 месяца назад

    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!? 😁

  • @konarksharma6524
    @konarksharma6524 2 месяца назад

    Buddy u have added value to my life in just 10 mins. No all other RUclipsrs are able to do that.

  • @Falkon712
    @Falkon712 2 месяца назад

    really appreciate your efforts ✅

    • @jonowilliams26
      @jonowilliams26 2 месяца назад

      Thank you! Glad you found it helpful.

  • @meowzhin
    @meowzhin 2 месяца назад

    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!

  • @blendzhegrova7106
    @blendzhegrova7106 3 месяца назад

    Excellent explanation, great job !

  • @DummyFace123
    @DummyFace123 3 месяца назад

    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.

  • @Mytthewx
    @Mytthewx 3 месяца назад

    Very nice montage but please talk little slower ;)

    • @jonowilliams26
      @jonowilliams26 3 месяца назад

      Thank you. Haha sorry about that. Will try next time!

    • @al3xg.0
      @al3xg.0 3 месяца назад

      ​@@jonowilliams26 just a lil bit tho, overall the pace is nice. Saved me the need to 1.5x

  • @sesseeeeeeeee
    @sesseeeeeeeee 3 месяца назад

    Such a well made video, liked + subbed (if i wasn't already subbed)

  • @aliensoul7600
    @aliensoul7600 3 месяца назад

    Thank you dude 👍🏼

  • @avinashsuresh5221
    @avinashsuresh5221 3 месяца назад

    This is surprisingly common thing to do. I didn't know it was called Strategy. Isn't this what interfaces are about?

    • @jonowilliams26
      @jonowilliams26 3 месяца назад

      Yep, it’s really simple and like you said, it’s common practice

  • @kalreengovender3895
    @kalreengovender3895 3 месяца назад

    Really great!! Loved this video

  • @alibabapour7418
    @alibabapour7418 3 месяца назад

    That's too much value in a single video Keep going bud 🎯

    • @jonowilliams26
      @jonowilliams26 3 месяца назад

      Thank you! Appreciate the positive feedback!

  • @alexmak5422
    @alexmak5422 3 месяца назад

    This is such a great video, cleared all my confusion on how to match these two patterns in 4 minutes !

  • @michaelakin766
    @michaelakin766 3 месяца назад

    Great video. Keep it up.

  • @woistdasniveau8290
    @woistdasniveau8290 3 месяца назад

    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?

  • @gigantedocil
    @gigantedocil 3 месяца назад

    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.

  • @ml_serenity
    @ml_serenity 3 месяца назад

    Confidently incorrect redditor. Nice explanation. +sub

  • @hemuutube
    @hemuutube 4 месяца назад

    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.

  • @iamdedlok
    @iamdedlok 4 месяца назад

    Just watched your simple breakdown of the Strategy Pattern and this one. You do have a skill for this. Keep posting, loving this. Subscribed.

  • @CharlieMarket
    @CharlieMarket 4 месяца назад

    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

  • @toddmoon500
    @toddmoon500 4 месяца назад

    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.

    • @jonowilliams26
      @jonowilliams26 4 месяца назад

      Sounds like unnecessary abstraction

  • @PaulSebastianM
    @PaulSebastianM 4 месяца назад

    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).

  • @oliverarmitage1966
    @oliverarmitage1966 4 месяца назад

    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.