The best Nuget package you’ve never heard of

Sdílet
Vložit
  • čas přidán 4. 05. 2022
  • Use code FULLTIME for 20% off (first 200 people): dometrain.com
    Become a Patreon and get source code access: / nickchapsas
    Hello everybody I'm Nick and in this video I will introduce you to a Nuget which is used in tons of places and has more than 350 MILLION downloads but you don't know about. It has some really practical usecases and we will take a look at them in this video.
    Give Castle.Core a star on Github: github.com/castleproject/Core
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    Keep coding merch: keepcoding.shop
    #csharp #dotnet #nuget

Komentáře • 153

  • @rade6063
    @rade6063 Před 2 lety +155

    Congratulations on becoming full time content creator. You deserve the best.

  • @somarzein8567
    @somarzein8567 Před 2 lety +53

    "Full time content creator". Too bad for hungry companies, too good for us developers :D. Thanks!

  • @winstonstrongarm8929
    @winstonstrongarm8929 Před 2 lety +58

    Love this series, it's like unboxing videos for coding

  • @gravious
    @gravious Před 2 lety

    Great video Nick, congratulations on the channel milestone

  • @brianp2780
    @brianp2780 Před 2 lety

    Congratulations Nick. It is well deserved, your expertise is the best.

  • @ronsijm
    @ronsijm Před 2 lety +27

    Also if you're testing, there's "Autofac.Extras.DynamicProxy" - which easily allows you to intercept anything, and then basically set up things, or detect things that you wouldn't detect otherwise. For example, for my APIs I have an interceptor "Exceptions must be documented" - the interceptor will make sure that if an exception leaves a controller, that controller has a swagger attribute of `[ProducesResponseType(typeof(InvalidDataException), 401)]` so that API consumers know what to expect

  • @GrimReaper160490
    @GrimReaper160490 Před 2 lety +1

    Congratulation Nick. You deserve it, your content is some of the best detailed guides that you can find on the internet. On wards and upwards my friend :) lets get to 150k by end of year.

  • @sofusskovgaard
    @sofusskovgaard Před 2 lety

    Thank you for the introduction, i will definitely be using this in the near future

  • @sinyor.611
    @sinyor.611 Před 2 lety

    Nice tricks, Nick. And congrats for becoming full time content creator, can't wait for another useful tutorial :)

  • @shaicohen2
    @shaicohen2 Před 2 lety

    Congrats Nick! Thank you for all the amazing knowledge!

  • @SchmataB
    @SchmataB Před 2 lety +1

    congrats! and yes, I never heard of this nuget although I use Moq on daily basis so thanks a lot for bringing this up.

  • @queenstownswords
    @queenstownswords Před 2 lety +5

    Congrats Nick. Your videos have always been high quality, a great learning tool, and a go-to reference. Between you, Tim Cory, and James Montemagno, I think you guys have C# covered.

  • @drewkillion2812
    @drewkillion2812 Před 2 lety

    Amazing. I love your content and glad we will get more!

  • @MrTJadam
    @MrTJadam Před 2 lety

    Congratulations man! Love your content!

  • @Rein______
    @Rein______ Před 2 lety +56

    I hope nuget packages like this are not bait for beginners so they make their codebase way to complicated. Add a few of these 'cool magic packages' together in the wrong hands and you have the maintenance nightmare of the future... A good enough design that is as simple as possible beats overengineering anytime. For me that means only use the minimum amount of packages, and only if it has a clear responsibility so it can be swapped out if that project dies or something...

    • @AlexMercer00
      @AlexMercer00 Před 2 lety +2

      You can say that about anything in programming as is not specific to this library. This was created because it solves a use case.

    • @Rein______
      @Rein______ Před 2 lety +2

      @@julealgon A lot of factors go in to this, project requirements, skill level, product lifetime. I agree on dont't reinvent the square wheel. Packages can hide complexity, you don't see it but it's still there. In my experience this hidden complexity is a major source of bugs and obstacles. A custom solution can have more visible lines of code, but a lower total complexity. No need to read poor documentation, hope for Google to point to solutions to problemens, you can just fix it, more freedom, and yes; more responsibility.

  • @thibaudgallanddemanneville174

    Congrats !! And thank you for the video !

  • @miroslavpolednak548
    @miroslavpolednak548 Před 2 lety

    Gratz Nick, your content is amazing. Keep doing it :)

  • @pawenowak5144
    @pawenowak5144 Před 2 lety

    Congratulations!:) And an idea about one of next videos: Your Blazor up-to-date impressons :)

  • @mahmoud.shaheen
    @mahmoud.shaheen Před 2 lety

    Congrats Nick!

  • @antonmartyniuk
    @antonmartyniuk Před 2 lety

    I have used this library for creating a RPC type of communication in production. It's a great tool

  • @clearlyunwell
    @clearlyunwell Před 2 lety

    Well done Nick! You are an inspiration!! 👍🏽

  •  Před 2 lety +3

    The performance pit in this scenario wouldn't be the call to the intercepted methods, but the building of the proxy... there is where all the "reflection magic" occurs .. in a containerized application wouldn't be that important since you only do this once at app startup, but it can be a big hit in performance for serverless functions for example, where every time your function does a cold start, all the reflection is done again... but yet, Castle.Core is a great library for some things if used carefully.

  • @Bholland31471
    @Bholland31471 Před 2 lety

    So happy for u. U make amazing content

  • @butchakakakopf2601
    @butchakakakopf2601 Před 2 lety

    Nice, bought one course dependency I. Thanks a lot

  • @cainux
    @cainux Před 2 lety

    This is awesome, I've been looking for something like this for a while now. Someone needs to make a modern version of the PolicyInjection library from years ago!

  • @eronmonseleoaikhina5832

    Congratulations Nick

  • @portlyoldman
    @portlyoldman Před 2 lety

    Congratulations mate, well done, love your work 😁😎. (Damn, I was hoping to hire you 😡)

  • @youlechen6902
    @youlechen6902 Před 2 lety +1

    Great video! Very informative! Will you be doing a video on asyncInterceptor by any chance? As far as I know, the asyncInterceptor package is not developed by castle team, and I'm quite worried about the performance.

  • @dcuccia
    @dcuccia Před 2 lety +4

    Great tutorial - had no idea AOP was this easy. Thanks for covering "But, Nick. Performance." How about "But, Nick. AOT compilation scenarios (no System.Reflection.Emit)."?

  •  Před 2 lety

    Nice Nick!

  • @OllyWood688
    @OllyWood688 Před 2 lety

    Since nobody else will do it I'll tip my hat at the suggestive thumbnail you absolute chad.

  • @donmorris4506
    @donmorris4506 Před 2 lety

    Glad you have been successful nick!

  • @minhgiangho1410
    @minhgiangho1410 Před 2 lety

    wow, I have researched about this lib before, but don't know how to use it. Thanks a lot

  • @sadaja25
    @sadaja25 Před 2 lety +6

    Hi Nick! The interceptor performance is great, but what happens if u have to get the method name? Does it get way slower?

    • @nickchapsas
      @nickchapsas  Před 2 lety +3

      Nop because you already have it. It’s a pre-computed property

  • @volodymyrliashenko1024

    This is exactly what I planned to do with a MiniProfiler.

  • @VipinBalakrishnan
    @VipinBalakrishnan Před 2 lety +1

    Very nice video. I was using this for logging and caching. Can you please make another video on async and await call on intercepting with castle proxy. For example by using asyncinterceptor. Also how do we manage the stacktrace on exception.

  • @seangwright
    @seangwright Před 2 lety +9

    Congrats on being able to do content creation and education full time. You're great at it!
    Re: Type-based decoration in C# doesn't scale...
    If you need to move away from SRP, then yes, you're going to have a lot of methods/properties to implement on each decorating type and maybe a class hierarchy might be a better option. But I try to avoid reaching for Castle or any other reflection based interception approach because it's so easy for the code to become really difficult to debug and understand. I haven't run into any situations in the projects I work on (other folks use-cases could be completely different) where I need AOP via Castle and Type-based decoration doesn't work.
    That said, the Castle project is really important to the .NET ecosystem and I use it every day (just not directly) for things like mocks in unit tests...

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Thanks! I don’t agree with said statement though. If separated correctly and with the right mechanism (attributes) it can scale really nicely.

    • @seangwright
      @seangwright Před 2 lety +3

      @@nickchapsas I was saying that in my experience, Type-based decoration scales just fine because you mentioned that it doesn't scale. The situations where Type-based decoration might not scale are when a type isn't adhering to Single Responsibility Principle (SRP). If it does, it will only have 1 or 2 methods (usually 1 in my experience), which is very very easy to decorate and looks like the "Intercept()" method you show with Castle.
      The situations where I see AOP via reflection go wrong is where developers try to put context in attributes with string patterns. Attributes are very poor at this. Instead the intercepted method's parameters and return types are so much easier to work with when doing Type-based decoration.
      If you are intercepting 1 method on a type with a huge public surface area (lots of methods/properties) then AOP via reflection is your best option, but this seems more suited to types you can't control. If you can control the types, try to follow SRP and then Type-based decoration is very easy to implement and maintain.

    • @ghostnguyen
      @ghostnguyen Před 10 měsíci

      @@seangwright
      Introduce to you the AOP library that none of reflection and simple with only two parameter-less attributes.
      nuget package InterfaceFillerCodeGen

  • @fakhrulhilal
    @fakhrulhilal Před 2 lety

    Amazing, I’ve been curious for how mocking framework works.

  • @uncommonbg
    @uncommonbg Před 2 lety

    I'm a little bit ashamed of myself that I haven't heard about this NuGet. This is pretty cool stuff.

  • @TridentTrue101
    @TridentTrue101 Před 2 lety

    The title and thumbnail makes this video look rather saucy.

  • @BeanCoffeeBean
    @BeanCoffeeBean Před 2 lety

    Imho these kind of videos are so important. A lot of new C# devs have no idea of all the possibilities, just because they have no idea about NuGet.

  • @ivandrofly
    @ivandrofly Před rokem

    Thanks

  • @SameerNafdey
    @SameerNafdey Před 2 lety

    Do you know how well does Interceptor works with Async methods? And what if you want to make async calls before intercepted async method?

  • @dnl_blkv
    @dnl_blkv Před 2 lety +1

    In a full decorator implementation, you'd just create a DecoratorBase with all the methods set virtual and calling the decorated instance by default, and then in concrete decorators you'd only override the methods you need to override :)
    Interceptors can still be massively useful in various cases, it is just that decorator is solvable in a nice manner without them %)

    • @nickchapsas
      @nickchapsas  Před 2 lety

      I find inheritance based decoration a very bad practice and very cluncky to work with

    • @dnl_blkv
      @dnl_blkv Před 2 lety

      @@nickchapsas idk, has been working alright for me. Might be a matter of taste...
      Also, it is not exactly inheritance-based, you do not extend the class to decorate it. You extend the DecoratorBase to build a decorator that works with any instance implementing the same interface as DecoratorBase... It is essentially the same thing you cover in the beginning of the video, but easier to add/delete/modify methods :)

    • @nickchapsas
      @nickchapsas  Před 2 lety

      @@dnl_blkv The difference is coupling. By basing it on the interface and then letting the IoC container do all the work, there is 0 coupling between classes that shouldn't know about each other.

    • @dnl_blkv
      @dnl_blkv Před 2 lety +1

      @@nickchapsas I don't think I see how an approach with DecoratorBase adds any uneeded coupling to be honest.
      So you suggested this as an alternative yo using Dynamic Proxies:
      1. IThing
      2. ThingSomethingDecorator : IThing
      I suggest:
      1. IThing
      2. ThingDecoratorBase : IThing
      3. ThingSomethingDecorator : ThingDecoratorBase
      (Not comparing the classic decorator to dynamic proxies here, only comparing the classic decorator to interface-only decorator, and still struggling to see how the interface-only version has lower coupling or is otherwise better in any sense :))

    • @ghostnguyen
      @ghostnguyen Před 10 měsíci

      @@dnl_blkv Do you have repo for example? So I can point out the coupling.

  • @andersborum9267
    @andersborum9267 Před 2 lety

    Scrutor is a very underrated API; it's awesome.

  • @sunefred
    @sunefred Před 2 lety

    This channel is the best Ad for Ride IDE you could ever ask for. How cool would it be for you to be sponsored by JetBrains?

  • @tobyjacobs1310
    @tobyjacobs1310 Před 2 lety

    Somehow when I saw the thumbnail my mind went to Castle. Such an awesome package.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      It’s one of those things that you might have heard of but never actually used yourself. At least it was for me

    • @tobyjacobs1310
      @tobyjacobs1310 Před 2 lety

      @@nickchapsas I think I started using it when I needed duck-typed composites to avoid statically defined `IFooAndBar : IFoo, IBar {}` scenarios. Overall I made things about 30% slower which was very much worth it in the context (small numbers)

  • @jmandiol
    @jmandiol Před 2 lety +1

    AOP, castle is a port from java. I think that have more the 20 years old the interceptor

  • @yaakovu
    @yaakovu Před rokem

    Hi, Thanks, very useful!
    How can I add DI extender, that contains AddInterceptedSingleton?

  • @IElial
    @IElial Před 2 lety

    That could answer my old S.O. question ! I wanted to decorate all Serilog logging methods (from static Log class). But ended up manually replicate all their alternate signature same method. It displeased me so I end up using my own custom sinks that do my extra decoration logic each time it log something. I get warned on S.O. it is not the purpose of a sink. So yeah finally maybe it could be a more elegant solution.

  • @jrqv
    @jrqv Před 2 lety

    Hmm, don't know if that thumbnail was supposed to be suggestive but I came here for the nuget packages nothing else!

  • @wheeals
    @wheeals Před 2 lety +2

    using the Castle.Core can you have multiple decorators on the same interface? on your example the IWeatherForecast?

    • @nickchapsas
      @nickchapsas  Před 2 lety +3

      You can yeah. The methods accept an array of interceptors so you can have as many as you want

    • @dimitryk8429
      @dimitryk8429 Před 2 lety

      ​@@nickchapsas IMHO it is not as good as it seems, it causes magic which causes pain, had seen 2 projects that became hard to support due to usage of this stuff

  • @nicktech2152
    @nicktech2152 Před 2 lety +1

    Nick, did you stop working at checkout? Do you think it will affect your prefessional development?

    • @nickchapsas
      @nickchapsas  Před 2 lety +2

      I did yeah. I don’t think it will, no. I’ve been through the whole stack for years and for the past year I didn’t write any code because I was a people manager. The content isn’t really driven from work anymore but my personal learnings

  • @juke-duke
    @juke-duke Před 2 lety

    can you make a video on how to make an API with Entity Framework for absolute beginners, Im having trouble finding a guide on this for newbies, thank you!

  • @MarcCabot
    @MarcCabot Před 2 lety

    I love how he says, "Let's go straight into the video" and then doesn't.

  • @limpalex
    @limpalex Před 2 lety

    Really great library. Although you should mention that for async methods this won't actually work. You have to add a continuation and log after task is completed/failed/cancelled.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      There is an async interceptors package that supports that

    • @limpalex
      @limpalex Před 2 lety

      @@nickchapsas awesome! thanks

  • @JoeFeser
    @JoeFeser Před 2 lety

    I would love to hear your opinion on this vs AOP programming. I unfortunately learn most of my .net core from you since I am still on the legacy version.

    • @reverser41
      @reverser41 Před 2 lety

      I was a great fan of AOP magic up until to the point where debugging production crash dump started becomming nightmare.

  • @one.pouria786
    @one.pouria786 Před rokem

    I think we can do it with Fody Addins as well, instead of castle core intercept. thank you anyway

  • @realkrzaku
    @realkrzaku Před rokem

    9:10 the interceptor should probably have been added as a singleton as well, no need to create it every time.

  • @Fred-yq3fs
    @Fred-yq3fs Před 2 lety

    oh my, this is gold. I have "legacy" code which inlines everything, so I've used scrutor/decorator to move out the cross cutting concerns. And this... is next level. I allows to do the same as decorators, but with a much quicker dev time. Love it. Thank you Nick.

  • @rivaligeralt
    @rivaligeralt Před 2 lety

    great upload, like always

  • @eliasluisjuradosantos6080

    use it! like we say in Peru : "give quality of life to yourself" XD

  • @nooftube2541
    @nooftube2541 Před 2 lety

    what about async? I suppose interceptor will track time only until ContinueWith.

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      There is an async interceptors package

  • @niroshakasthala1384
    @niroshakasthala1384 Před 2 lety

    Anybody used IAsyncInterceptor with Polly for handling exceptions or throttling?

  • @buergerliche_kategorien

    At least the "logging" example you can easily active with request filters no packages are needed.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      But that’s request logging. How do you narrow it down to specific services?

  • @kurtcochran9170
    @kurtcochran9170 Před 2 lety

    Nick, I tried this using your example code, but I cannot seem to find the IServiceCollection method "AddInterceptedSingleton". I initially tried Castle.Core v5, then tried the same version as yours (4.4.1), but the method wouldn't resolve. My project is a .NET 6 console app. Can you help?

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      That's a method I wrote myself, it's not part of Castle

    • @kurtcochran9170
      @kurtcochran9170 Před 2 lety

      @@nickchapsas Ah yes, thanks. I had watched this video a few weeks ago, and then was following along step-by-step last night. I paused it when I couldn't find the method, and forgot you'd written it! Excellent video BTW.

  • @mikeschnobrich1807
    @mikeschnobrich1807 Před 2 lety +1

    What is the security risk using 3rd party packages that are dependent on other 3rd party packages? Can someone update a dependent package without changing the version of the package it depends on?

    • @alanbourke4069
      @alanbourke4069 Před 2 lety

      The security risk is huge especially in the Linux world.

    • @philliplevinson2535
      @philliplevinson2535 Před 2 lety

      Generically if you're worried about this kind of stuff and are of any size you will have a local npm to cache, and you will have md5 hashing checks for Library validation, and at larger sizes even have a group that does security validation of open source libraries being used, honestly the biggest safety valve is generally just not upgrading off of a "known" safe version which is how we often end up with such stale tech stacks. There have been widespread vulnerabilities discovered and it's just something you deal with, you can't be expected to make modern software efficiently without building on libraries.

  • @Ayymoss
    @Ayymoss Před 2 lety +4

    Please can you do a full tutorial with Blazor?
    Including EFCore (Relationships), Database Integration, Login/Registration and Authentication including Auth Roles etc.
    I don't care if it's like a 10-hour tutorial. :)

    • @AhmetArat1
      @AhmetArat1 Před 2 lety

      Yes I second that, that would be awesome. 20-hour is also good.

  • @vadimbondaruk8133
    @vadimbondaruk8133 Před 2 lety

    What about interception of async methods?

    • @nickchapsas
      @nickchapsas  Před 2 lety +4

      There is a separate AsyncInterceptors package from castle that has a sync interceptors

  • @levmatta
    @levmatta Před 2 lety

    Does SimpleInjector do this ? As efficiently ?

    • @nickchapsas
      @nickchapsas  Před 2 lety

      SimpleInjector is an ioc framework. It’s a different thing all together

    • @levmatta
      @levmatta Před 2 lety

      @@nickchapsas It has a extension for it InterceptionExtensions -- but for my ignorance the surprise is that Castle is NOT. I googled it, only Windsor -- OK
      THANKS!!!! (aand sorry for the time waist)

  • @jamesherrero7334
    @jamesherrero7334 Před 2 lety

    Boom bought miminal API!

  • @keshavt6982
    @keshavt6982 Před rokem

    Make a video why you use rider instead of visual studio please

  • @JacobSilvia
    @JacobSilvia Před 2 lety +2

    System.Reflection.DispatchProxy does something remarkably similar. That's what I use for interceptor proxies.

  • @ognjenzivic8674
    @ognjenzivic8674 Před 2 lety

    Could you also make a video for async version?

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      You can use the async interceptors package

    • @clementdurazzo4774
      @clementdurazzo4774 Před 2 lety

      @@nickchapsas that’s the info I was looking for the entire video !! 😅 I’ll look into it !! Thanks

  • @vasiliychernov2123
    @vasiliychernov2123 Před 2 lety

    Interesting! Java has dynamic proxies out of the box, and Retrofit, a popular library for creating type-safe API clients, is implemented with dynamic proxy.

  • @yuragutyk8028
    @yuragutyk8028 Před 2 lety +3

    "Why aspect-oriented programming in C# is pointless" 👀

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      This isn’t aspect originated programming. It’s like saying that a middleware or a filter in ASP.NET Core is AOP. It goes way beyond interception

  • @nayanchoudhary4353
    @nayanchoudhary4353 Před 2 lety +1

    Please share code for this example

  • @ChaimMosheStern
    @ChaimMosheStern Před 2 lety +3

    For simple measure time, Why not just make your own middleware?

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      Because middleware is endpoint wide and it measures things across the full request. what if you wanna measure a specific method? What if you wanna measure how long you take to process a message? This generic approach is way more flexible

  • @gerarduab9960
    @gerarduab9960 Před 2 lety

    Do it with less phrases decorator pattern

  • @Andrei-gt7pw
    @Andrei-gt7pw Před 2 lety

    Awesome. LIke.

  • @infeltk
    @infeltk Před rokem

    I would have known nuget cost-free package that helps for injecion services to the class and then I wouldn't have to create constructor with optional NullArgumentException.

  • @davidc1179
    @davidc1179 Před 2 lety

    Why not talking about postsharp ? It does AOP without polluting your code with proxies.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Because I don’t like AOP or postsharp. And no, just method interception, isn’t AOP

  • @stsrki
    @stsrki Před 2 lety

    How about giving Blazorise a chance?

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      I don't do Blazor so I don't think this would happen

  • @codeforme8860
    @codeforme8860 Před 2 lety +1

    Are you quiting checkout?

  • @josecorreo646
    @josecorreo646 Před 2 lety

    Does not work for async methods... proceed returns inmediately :(

    • @nickchapsas
      @nickchapsas  Před 2 lety

      There is an async version of the package

  • @adamgrey268
    @adamgrey268 Před 2 lety

    I've been coding for like a year now. How do I bridge the gap--how do I understand what is going on in these videos?! lol

    • @CallumBradbury
      @CallumBradbury Před 2 lety +2

      Just keep coding, trying new things, pushing your limits. The gap will be bridged via time, shortcuts will cripple your mindset.

  • @matthewsheeran
    @matthewsheeran Před 2 lety

    Tip: name the NuGet package up front and not well into the video.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      It’s in the description. There is no point throwing a package name of you don’t understand what it is and why it exists

  • @JohanNordberg
    @JohanNordberg Před 2 lety +2

    Title in thumbnail should be used as a pickup line. Expected conversion rate?

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      What's funny is it honestly didn't cross my mind that it would be suggestive 😂

    • @JohanNordberg
      @JohanNordberg Před 2 lety

      @@nickchapsas Probably says more about me than you. :)
      Btw, I think you really nailed the scope and length of your videos. 10-15 minutes are perfect. (Just talking about videos haha)

    • @zabustifu
      @zabustifu Před 2 lety +2

      The face he makes in the thumbnail definitely sells it.

  • @Philinnor
    @Philinnor Před 2 lety

    make timestamps for your videos

  • @xdjiijii6543
    @xdjiijii6543 Před 2 lety +1

    Please next time at least loosely connect title with what package is doing :S

    • @nickchapsas
      @nickchapsas  Před 2 lety +3

      That’s not how titles work

    • @xdjiijii6543
      @xdjiijii6543 Před 2 lety

      ​@@nickchapsas Idk, felt clickbaity to me, but im not content creator, nor my english is the best so nvm.
      Anyways GZ on huge milestone. Looking forward for new C# content ^^

  • @swaipa
    @swaipa Před 2 lety

    Plz, let this be your last click bait...

    • @nickchapsas
      @nickchapsas  Před 2 lety +6

      It won't and here is the thing. People don't understand how clickable titles work. If the title was "How to use Castle.Core to create interceptors" or "Creating Dynamic Proxies in C#" then best case scenario 1/10 people would actually watch the video for the simple reason that you need to know what those things are before you watch the video. What is Castle? What is Castle.Core? What is a dynamic proxy? What is an interceptor? People don't know what they don't know and these titles make for honest titles but not clickable titles. Ultimately the goal is to get people to click and watch the video. Real clickbait is shut down by CZcams very quickly. The fact that the video gets views, positive comments and likes means that people watch it. That's the definition of legitbait. So no, my titles will keep following the format that I think is appropriate in order to get as many people to learn as possible. If that's not your cup of tea you can unsubscribe and mute the channel.

  • @jeffb4118
    @jeffb4118 Před 2 lety +1

    This video setup is weird.. did developers need clickbait and surprise lessons on random packages?
    I think it would be more useful if you could search for it by topic when you needed to find it?

    • @nickchapsas
      @nickchapsas  Před 2 lety

      They did actually. Something is clickbait when the video content doesn't deliver to the perceived promise of the title. As you can see by the comments and the performance of the video, most people didn't know about this. True clickbait videos get buried into the groud by YT's algorithm so if a video does well, it wasn't clikbait. It was just clickable. You assume that "How to create dynamic proxies in C#" would be a better name, but unfortunately, you are wrong. Such a title assumes that the person reading it, knows what a dynamic proxy is in the first place, rendering it useless because if you know what they are, then most likely you know how to implement them. So, yes, for CZcams educational content, such titles are just needed, they are a must.

  • @robertkrakow7111
    @robertkrakow7111 Před 2 lety

    Bloated architecture

  • @panosru
    @panosru Před rokem

    Castle.Core is a great package (I'm using it in conjunction with Castle.Core.AsyncInterceptor), I would also suggest you take a look at the AspectCore package, it has 1.5k stars and I found it very easy to use for achieving AOP features as you point in your video, the only downside (and a deal-breaker for me) is that it is not working with Scrutor Decorate method.

  • @AshaD2345
    @AshaD2345 Před 2 lety

    Love this! Very elegant. It appears CreateInterfaceProxyWithTarget() takes params[] IInteceptor so you can pass an array of interceptors too.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Correct and the order matters. It effectively creates a pipeline

  • @PiotrLipson
    @PiotrLipson Před 2 lety

    I was looking for c# counterpart of java.lang.reflect.Proxy and this looks to be exactly it! Thanks!

  • @meraname3858
    @meraname3858 Před 2 lety

    You should have told the package name in video title, this wasted a lot of time until i reached the word Castle.Core, i already know about!!

  • @owninggreendragsdude
    @owninggreendragsdude Před 2 lety

    invokation.Method.Name get the method name, is there a way to get the classname? The method names will overlap between classes. Thanks for the video!

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Yeah there is a Type property in there

    • @owninggreendragsdude
      @owninggreendragsdude Před 2 lety

      @@nickchapsas I was able to get the proxy interface of the class with new StackTrace().GetFrame(2).GetMethod().ReflectedType.Name, which is good enough to identify the class

  • @markovcd
    @markovcd Před 2 lety

    Scrutor is fun but it makes order of calls in register types matter. This breaks the default behavior of container builder. Its a shame because the easy fix would be structuring the api differently. For example: services.AddTransientForDecoration().DecorateWith().DecorateWith()