One Simple Tip for Cleaner Code In Web APIs

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

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

  • @Артем-ш4ь7ж
    @Артем-ш4ь7ж 4 года назад +3

    Also you can create custom middleware with handle exception logic. It's incapsulate logic in separate class and allow to reuse it in different services

  • @IssaFram
    @IssaFram 4 года назад +14

    Be careful with dependency injection in that middleware code. A transient dependency could be killer when running thousands of requests. Great video though, easy to understand.

  • @fbsouza
    @fbsouza 3 года назад

    I like because your videos is short. That's why I subscribe 👍

  • @NotATrucks
    @NotATrucks 4 года назад +2

    Nice vid, another little droplet to convince me moving our projects to the .net core

  • @somendrapratapsingh8911
    @somendrapratapsingh8911 3 года назад

    Hii Jonathan Williams,
    Please upload more video .net angular and API your explanation is awsome I'm waiting for your video for a long time.

  • @redmizaki5838
    @redmizaki5838 3 года назад +1

    Thanks a bunch, very beneficial!

  • @niroshanmanoharan4295
    @niroshanmanoharan4295 4 года назад +1

    Another great video. Thank you!

  • @samithraniroshana4089
    @samithraniroshana4089 4 года назад

    Thanks for taught new things. plz, do more of this kind of cool video instead of traditional boring stuff.
    ✌️✌️

  • @HunnisJourney
    @HunnisJourney 3 года назад

    This is an awesome video! Good and easy to understand, Thank you!

  • @tomsupis8724
    @tomsupis8724 4 года назад +1

    Nice video, thanks. I can use this for my .NET Core app as well right? Dont have to be API?

    • @jonowilliams26
      @jonowilliams26  4 года назад

      Thanks ! Appreciate the positive feedback. As far as I am aware it needs to be an API because the API has the middleware pipeline. A console app for example doesn’t have a pipeline

  • @MattStrokes
    @MattStrokes 3 года назад +1

    Nice!

  • @cehlo121
    @cehlo121 4 года назад +1

    Really interesting, I've never used this before, does it have any impact on performance?

    • @jonowilliams26
      @jonowilliams26  4 года назад

      I don’t think this will effect performance. It’s Microsoft’s recommend way to handle errors in .NET Core. I haven’t done extensive testing though. Check out the docs: docs.microsoft.com/en-us/aspnet/core/web-api/handle-errors?view=aspnetcore-5.0

  • @bagusanggoro5999
    @bagusanggoro5999 4 года назад

    can i use web api to other web api or use this web api but different port to read and write to database .. sorry my english is not good. thank you for the response .. 😊😊😊😊😊

  • @Simongtt
    @Simongtt 3 года назад +1

    I'm lead Dev for a large UK retailer, web really need to leave framework and go to core, but framework is so engrained in the business! We are starting some new projects soon, so they got to be core.
    Great videos mate, keep them coming.

    • @jonowilliams26
      @jonowilliams26  3 года назад

      Thanks Simon ! .NET core all the way 💪

    • @Simongtt
      @Simongtt 3 года назад

      @@jonowilliams26 Its gotta happen mate! Just such a big task for us.

    • @Simongtt
      @Simongtt 3 года назад

      @@jonowilliams26 And as if by magic, just made a little app that will run as a service and poll a directory for changes (.dat files), read, add to db and then on to a third parties SFTP, all in core.

    • @adamstorruk
      @adamstorruk 3 года назад

      @@Simongtt Moving an existing system over is a big job as you can imagine. The business will have to see the benefit of it. Another way is to write all new features/apis etc. in dotnet core / dotnet 5 and show performance improvements and other benefits etc. and then hopefully you'll move over as you go gradually. Good luck!