This project is read-only.

Interception DLL or VB Equivalent Code

Mar 22, 2012 at 6:43 PM


I found this interceptor extension here:

Is there a VB equivalent, because I'm converting it after first running it through, but I'm not sure if it's 100% right...

Also, is this in a component somewhere?  It be nice if it were in a DLL I could then just reference....

Mar 22, 2012 at 11:34 PM

Hi Bmains,

Online converters will trip over the use of lambda expressions and event registration syntax. I tried to convert the code to VB, but unfortunately I did not succeed (my VB is lousy). If you want to use it in a VB project, I advise you to create a DLL out of it using a C# project.

Having a SimpleInjector.Interception.dll (and NuGet package) would perhaps be nice, however, there might be a point that the things we are doing can't be considered 'simple' any more :-). But besides that, there is much more needed in making such package, than just the current code samples. First of all I'm not sure whether using .NET's real proxy is good (and fast) enough, since performance is a key feature of the Simple Injector. Instead, the component should probably make use of one of the existing dynamic proxy frameworks out there. Also the current API has to be given some thought. Is this API good enough, or should there be more extension methods? Next it has to be documented properly, both in XML docs and on the website. And it has to be tested, released, maintained.

That's the reason I posted the interception as code sample on the website. It gives users the change to use it and give feedback, while this gives me some time to think about whether supporting interception as extension is a good idea, and to come with a better design. However, don't expect any package soon.


Marked as answer by dot_NET_Junkie on 11/3/2013 at 11:49 PM