Virtual Method Instance Interceptor
Intercepting the database connection is a head ache any day, the unity implementation of transparent proxy does not work here at all.
We want a type safe instance interception mechanism supporting the interception of calls even on the sealed classes; more like a VirtualMethodInstanceProxy
Please note that this is supported already by Linfu using the Mono.Cecil; bringing this support to unity will make it powerful enough to cater any interception requirements.
Had this done back in v2.
-
Kiran Chand Palakkattiri commented
@Grigori Melnik: Virtual Method Interceptor is a type interceptor, but not an instance interceptor.
Hence it will not be possible to use a Virtual Method Interceptor for intercepting "SqlCommand" or "SqlConnection" as they are sealed.
Creating a Virtual Method Instance Interceptor from the base class, passing the actual instances will help in intercepting the sealed classes as well. Hope this explanation helps.
--
Regards
Kiran Chand Palakkattiri
kiran.chand@live.in -
Why would not the currently available Virtual Method type interceptor suffice?
-
Marcoslimagon commented
This is a really useful idea. I want to intercept ExecuteScalar/ExecuteReader/ExecuteDataset. I would like to set Context_info with my Context.User.Identity.Name, to improve my change data tracking feature
-
Kiran Chand Palakkattiri commented
Here is the discussion I have started on the unity project hosted on codeplex.