c# - Fetch parameters name and values of method throwing exception -


i have 2 classes code

[exceptionaspect] public class baseservice {     public void method1(string email)     {         new businessclass().method2(1, email, false);     } }  public class businessclass {     public void method2(int count, string email, bool ignorecase)     {         throw new notimplementedexception();     } } 

my exception aspect class has following code , using code i'm able fetch parameters name , values of method1 not of method2.

[serializable] public class exceptionaspect : onexceptionaspect {     public override void onexception(methodexecutionargs eventargs)     {         object[] args = null;         if (eventargs.arguments != null)             args = eventargs.arguments.toarray();          var parameters = eventargs.method.getparameters();     } } 

now want fetch , save method parameters name , values of exception target site i.e. count=1,email=email , ignorecase=false of method name method2.

add attribute businessclass.

[exceptionaspect] public class businessclass 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -