Coding Shorts: ASP.NET Core Middleware Explained

แชร์
ฝัง

ความคิดเห็น • 82

  • @pramodnaik1011
    @pramodnaik1011 ปีที่แล้ว +7

    Beautifully explained. I was too confused about middleware and how it works. Now I got a clear picture.

  • @DonovanChilders
    @DonovanChilders 2 ปีที่แล้ว +21

    This is awesome. Middleware has always been a fuzzy subject for me but this is helping to make more sense of things. Looking forward to the rest of this series!

  • @johns4651
    @johns4651 2 ปีที่แล้ว +1

    Thank you Shawn, saved to my "Watch Later" for mandatory viewing.

  • @marcouitendaal985
    @marcouitendaal985 หลายเดือนก่อน

    Click! First video I watched on your channel. And that bit on invoking next with context... Nice. that helped something click in my mind. Subscribed.

    • @swildermuth
      @swildermuth  หลายเดือนก่อน

      Glad it was helpful!

  • @bryanacevedo9882
    @bryanacevedo9882 2 ปีที่แล้ว +2

    Very clear explanation. Building up from doing this directly in the program then moving it to a middleware class made it easy to follow and understand.

    • @swildermuth
      @swildermuth  2 ปีที่แล้ว

      Awesome, glad you liked it.

  • @lukegcollins
    @lukegcollins 2 ปีที่แล้ว +2

    You've earned yourself another sub. Can't wait to go through the rest of your content in my spare time.

    • @swildermuth
      @swildermuth  2 ปีที่แล้ว

      Thanks for subscribing! I'll have a new video about once a week.

  • @davestorm6718
    @davestorm6718 2 ปีที่แล้ว +3

    Not enough tutorials on middleware related to making your own. Thanks a ton! I've been mulling through many MS docs on the topic w/a blank stare for quite some time with the goal of creating custom middleware that detects IPaddress and other client info from bad actors and wanting to terminate the request when visits (unauthenticated) appear to be coming from spambots and hackerbots (to eliminate the extreme wastefulness of resources when my site(s) are attacked or deluged with bad traffic). I like to log extreme attacks into a queue outside of the web server, asynchronously, for future parsing and hacker profiling - (had a system I wrote years ago that did this from an IIS extension & it worked extremely well and wanted to make it more portable).

  • @80amnesia
    @80amnesia ปีที่แล้ว +1

    always clean and simple explanations

  • @mubarekabdi
    @mubarekabdi ปีที่แล้ว

    That was calm and cool. Appreciate the way you explain

  • @MilosBencek
    @MilosBencek 7 หลายเดือนก่อน +1

    thanks for posting Shawn. Looks to me like middleware is technically a node in a linked list, passing request http context to the next node and back recursively.

  • @edward_t450
    @edward_t450 2 ปีที่แล้ว +1

    Very Good, Shawn. Keep up the good work.

  • @hozmannew896
    @hozmannew896 2 ปีที่แล้ว +1

    You make everything simple like charm, very useful , thank you so much

  • @borispaunovic965
    @borispaunovic965 ปีที่แล้ว +1

    i like this dude he is a good teacher

  • @farisarx5552
    @farisarx5552 2 ปีที่แล้ว +1

    Just Woow this the best explanation I've seen so far, I really struggled learning about how middleware works so thank you so much , hope you tell us how we learn how to learn this kinds on concepts , keep going :)

  • @prakashpoudel7536
    @prakashpoudel7536 2 ปีที่แล้ว +1

    You are a legend mate. Really well explained

  • @waynegreen7970
    @waynegreen7970 2 ปีที่แล้ว +1

    As always, great content. Your courses, content, and newsletter have helped me a lot.

  • @tedstidham
    @tedstidham 2 ปีที่แล้ว +1

    Always amazing content. Very will explained!!! Thanks!

  • @yeshapurohit9592
    @yeshapurohit9592 4 หลายเดือนก่อน

    Nicely explained!

  • @jeromericohermoso1115
    @jeromericohermoso1115 ปีที่แล้ว

    Awesome video. Definitely helped me understand this subject. Thank you very much!

  • @stanst2755
    @stanst2755 ปีที่แล้ว

    Very good and informative explanation.

  • @Mercino311
    @Mercino311 2 ปีที่แล้ว

    Incredible explanation! Thank you for sharing this with us.

  • @abdulazizasiri2708
    @abdulazizasiri2708 ปีที่แล้ว

    Amazing explanation Thanks Shawn !

  • @lazarnikolovski7571
    @lazarnikolovski7571 ปีที่แล้ว

    This was an amazing video! Great explanation. Thank you!

  • @peterwidmer8841
    @peterwidmer8841 2 ปีที่แล้ว

    Very nice and easy understandable explanation! I enjoyed it alot, thank you!

  • @vert3cx373
    @vert3cx373 ปีที่แล้ว

    Thanks a bunch for the awesome video!

  • @kodindoyannick5328
    @kodindoyannick5328 9 หลายเดือนก่อน

    Great video! Thank you so much.

    • @swildermuth
      @swildermuth  9 หลายเดือนก่อน

      You're very welcome!

  • @joaoqueiros2036
    @joaoqueiros2036 ปีที่แล้ว

    Thank you for the clear explanation! :)

    • @swildermuth
      @swildermuth  ปีที่แล้ว +1

      Glad it was helpful!

  • @anguswalker7511
    @anguswalker7511 2 ปีที่แล้ว

    This is awesome. Nice job!

  • @persiansayed
    @persiansayed ปีที่แล้ว

    Thank you so much for such a great video. Nice explanation! 👍

    • @swildermuth
      @swildermuth  ปีที่แล้ว +1

      You're very welcome!

  • @MasterOfMisc
    @MasterOfMisc 2 ปีที่แล้ว

    Great Vid. Awesome explanation! 👍

  • @kevinlopez4900
    @kevinlopez4900 2 ปีที่แล้ว

    First time watcher this was a great video, just subscribed. Are you planning on making videos on identity server, authentication or authorization?

    • @swildermuth
      @swildermuth  2 ปีที่แล้ว

      Auth, yes. But Identity Server is being replaced by a MSFT tool that won't have runtime license needs.

  • @yaredalmaw6644
    @yaredalmaw6644 2 ปีที่แล้ว +1

    This is really nice

  • @henrik3098
    @henrik3098 ปีที่แล้ว

    thanks sean, good video man :)

    • @swildermuth
      @swildermuth  ปีที่แล้ว

      You're welcome - no matter how you spell my name ; )

    • @henrik3098
      @henrik3098 ปีที่แล้ว

      sorry Shawn wont happend again@@swildermuth

  • @VirusZer0
    @VirusZer0 ปีที่แล้ว

    Thank you this was great!

  • @たろ羊
    @たろ羊 2 ปีที่แล้ว

    Looking forward to the next video in the middleware series!
    Question. Why do you abbreviate context as ctx? I always thought writing "context" made it clearer what it was when browsing over code

    • @swildermuth
      @swildermuth  2 ปีที่แล้ว

      Old habit, probably not a best practice. I use these common shorter variables:
      - context: ctx
      - builder: bldr
      - options: opt

  • @codearabawy
    @codearabawy ปีที่แล้ว

    Thank you very much for the explanation! @swildermuth Why we need AddTransient here and not Singleton?

    • @swildermuth
      @swildermuth  ปีที่แล้ว

      AddTransient is for stateless objects, where as a singleton is shared by everyone who requests it. I tend to want more Transient (smaller) than Singletons. I only use Singletons if I really have to have shared state (IConfiguration is static as an example).

  • @apinzonf
    @apinzonf 2 ปีที่แล้ว

    Excelente video, muy bien explicado👍

  • @mihainegrisan
    @mihainegrisan 2 หลายเดือนก่อน

    Thank you!

  • @alinazar7998
    @alinazar7998 2 ปีที่แล้ว

    Very good!

  • @nathanwaterman4380
    @nathanwaterman4380 5 หลายเดือนก่อน

    What was the next lesson in the middleware series called?

    • @swildermuth
      @swildermuth  5 หลายเดือนก่อน

      Not sure I had a 2nd part, did I promise one? (been a while since I made this).

    • @nathanwaterman4380
      @nathanwaterman4380 5 หลายเดือนก่อน

      @@swildermuth Yes you had mentioned at the start of the video it was going to be multi-part I believe.

  • @jayakumar2927
    @jayakumar2927 2 ปีที่แล้ว

    In the TimingMiddleware class how to invoke automatically Invoke method it is not working

    • @swildermuth
      @swildermuth  2 ปีที่แล้ว

      Can you share your code?

    • @jayakumar2927
      @jayakumar2927 ปีที่แล้ว

      @@swildermuth I did not have code . I am watching your video. Can you share Github link

  • @nazim9639
    @nazim9639 10 หลายเดือนก่อน

    >coding "shorts"
    >20 minutes

  • @jayakumar2927
    @jayakumar2927 2 ปีที่แล้ว

    can you share code

  • @liquidcode1704
    @liquidcode1704 2 ปีที่แล้ว +1

    Middleware and Microservices!!!!

  • @mocococo2877
    @mocococo2877 ปีที่แล้ว

    I thank you for your time and efforts for that tutorial. I usually like your tutorials and I know you by name from many tutorial's series. But this one was about some chaotic useless examples. You did not mention one example that might be really useful about that middleware.

    • @swildermuth
      @swildermuth  ปีที่แล้ว

      yes, it was a useless example to show the simplicity of the middleware. But you could imaging logging and performance in a middleware. I've used it to support caching or early execution of code (e.g. calculate the connection string based on authentication).

  • @DSSPOA
    @DSSPOA ปีที่แล้ว

    awesome content, don’t listen your wife XD… quick question is there an easy/feasible way to time measure all middlewares? yeah, I’m looking at you telemetry….

    • @swildermuth
      @swildermuth  ปีที่แล้ว +1

      I don't think there is any way to do that out of the box, but I've done this with a small middleware that I plug into different places to see where bottlenecks are, but I'd not use them in production.

    • @DSSPOA
      @DSSPOA ปีที่แล้ว

      ​@@swildermuth That's what I thought, but thanks for answering back =) To make it even complicated, it's happening with a legacy .net framework system, oh boy ...

  • @tbremard
    @tbremard 2 ปีที่แล้ว +1

    Thank you so much! This is the middleware I have created
    th-cam.com/video/ltwTzyTOnKY/w-d-xo.html