how to use both custom handler and ValidationCallHandler in the same method?

Topics: Building and extending application blocks, Enterprise Library Core, General discussion, Policy Injection Application Block, Validation Application Block
May 31, 2011 at 3:57 AM

 For example,I want  to use customCallHandler and ValidationCallHandler  in the Deposit method,

and I instance the BankAccount by the following code ,but it always throw exception,so I want to know how to instance the class?

thank you!


      IUnityContainer container =container.AddNewExtension<Interception>();
           new InterceptionBehavior<PolicyInjectionBehavior>(),
           new Interceptor<TransparentProxyInterceptor>());

      bankAccount = container.Resolve<BusinessLogic.BankAccount>();


public sealed class BankAccount : MarshalByRefObject
        public void Deposit([RangeValidator(typeof(Decimal), "0.0",
                     RangeBoundaryType.Exclusive, "0.0",
                     RangeBoundaryType.Ignore)] decimal depositAmount)
            balance += depositAmount;

May 31, 2011 at 4:00 AM

by the way,I use the enterprises libarary 5.0 and unity 2.0

May 31, 2011 at 8:10 AM

I've already answered in the same topic in the Unity Forum - HTH

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.