ASP.NET Core Web API .NET 8 2024 - 10. Repository Pattern + DI

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • ASP.NET Core Web API .NET 8 2024 - 10. Repository Pattern + Dependency Injection
    Github repository for the project: github.com/ted...
    Twitter: / teddysmithdev
    Github: github.com/ted...
    Linkedin: / teddy-smith-015ba61a3

Комментарии • 30

  • @alreadyghosts7727
    @alreadyghosts7727 26 дней назад +2

    Finally, a human-readable explanation of DI. Thanks!!

  • @kushalbhargava8212
    @kushalbhargava8212 8 месяцев назад +4

    Wonderful Sir
    I was struggling with DI but now it's clear as crystal

  • @LearnwithChampzz-rv4lk
    @LearnwithChampzz-rv4lk 3 месяца назад +3

    Teddy, I really loved your approach of teaching. You could have made us use Interface/repo from the start. But you incrementally teaching us How the coding approaches are evolved and make the code look better and better. Much Thanks

  • @JDhillon24
    @JDhillon24 6 месяцев назад +8

    the concept of dependency injection didn't fully click until i heard "we need to preheat the metaphorical code oven". great video

    • @marin1419
      @marin1419 4 месяца назад +1

      Possibly the best quote in the history of C# development

  • @SmittyRG
    @SmittyRG 8 месяцев назад

    Pure gold. Great explanation of repository usage. 😃👍🏼

  • @DarlingtonAzramShoniwa
    @DarlingtonAzramShoniwa 5 месяцев назад

    thank you, Teddy, I am following you everyway

  • @LiranDanino
    @LiranDanino 6 месяцев назад

    Wonderful Thank you so much 😍

  • @fifty-plus
    @fifty-plus 9 месяцев назад +3

    I'd rather name those as SomethingService : ISomethingService. It's a small differentiator but EF already implements the repository pattern so there's no point re-implementing anything that looks like a repository or unit of work pattern and naming it away from that is at least a mental reminder it isn't a repository when it's being implemented or refactored.

  • @untalentedwebdev
    @untalentedwebdev 7 месяцев назад +1

    amazing teacher

    • @TeddySmithDev
      @TeddySmithDev  7 месяцев назад +2

      I laughed at the username 🤣

  • @_Apep_
    @_Apep_ 5 месяцев назад

    Why the IStockRepository and the StockRepository should be added into the Program .cs as a Service? Isn't enough accessing the "GetAllAsyc()" on the Controller just with the DI there?

  • @sayat1997ify
    @sayat1997ify 8 месяцев назад

    Hi man. Those vids are lit 🔥🔥🔥

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

    Nice content as always 🤩

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

    How to implement Interface ? When I press ctrl + dot. I don't have an option to implement interface (4:35). Do you use any extension or something else to get this option?

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

      Download VS Code extension C# dev kit by Microsoft and C# extensions by JosCreativ

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

      @@TeddySmithDev Watching your tutorials, they are Great!!! I had these extension from previous lessons. Now everything working after restarting VS code. Many Thanks

  • @kvelez
    @kvelez 5 месяцев назад

    Cool refactor.

  • @shivpratapshukl1445
    @shivpratapshukl1445 9 месяцев назад +2

    Hi old friend, do you have any interest on doing microservices in dotnet core.

    • @TeddySmithDev
      @TeddySmithDev  9 месяцев назад +5

      Yes, but it would be long time from now

    • @tarekabiramia913
      @tarekabiramia913 8 месяцев назад

      why so ? is it not used in work env ?@@TeddySmithDev

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

    how to get "New C#" on right click ? which extension?

  • @Mo_ali2905
    @Mo_ali2905 5 месяцев назад

    8.43 Having _context parameter and injecting it in Stockcontroller constructor is unnecessary since you used it and inject it in stock repository.

  • @yngsheikh
    @yngsheikh 9 месяцев назад

    🔥

  • @oussamahdidou6247
    @oussamahdidou6247 9 месяцев назад +1

    can u make videos about .net maui blazor hybride

    • @TeddySmithDev
      @TeddySmithDev  9 месяцев назад

      I'd do Blazor/MAUI but nobody hires in it around me so I stay out

  • @Tim_Obozny
    @Tim_Obozny 3 месяца назад +1

    10:14 GetAll() method: return stock, but we need to return stockDto? Or I wrong? tnx for your answer

    • @MihoubAhmed1
      @MihoubAhmed1 21 день назад

      you forgot the second code line on the GetAll() Function under the controller : var stockDto = stocks.Select(s => s.ToStockDto());
      that adapt the response from database to the Dto form