Is there a way to achieve this with PI?

Topics: Policy Injection Application Block
Nov 21, 2007 at 1:29 PM
I would like to call to a attributed method inside the current object but I want the attribute of the called method to work. I know that inside the object I am not using the ghost proxy, but I suppose it must be some smart way to do that.

Any ideas?

TransactionCallHandlerAttribute()
public void F1()
{
F2();
}

TransactionCallHandlerAttribute()
public void F2()
{

}

Thanks in advance.
Nov 22, 2007 at 11:37 AM
No, it's not possible to get PI without a proxy.

If you look at the description for the runtime behavior (ms-help://ms.EntLib.2007May/EnterpriseLibrary/html/09-850-Runtime_Behavior_of_the_Policy_Injection_Application_Block.htm) you will see that the attributes are just a means to describe a handler pipeline that is used by the proxy to do the injection. The this reference wil point to "Target Object", not to the proxy, so PI won't happen.

Ffernando