Closed osmanrahimi closed 6 years ago
Can you provide more context with your question. It's unclear to me what you are trying to achieve, and what the problem is.
Sorry . With Castle.core Library it's pssible to get Method Name with its arguments like this:
invocation.Method
I just wanted to know can I do this ? for getting method name and argument I used this:
public void Intercept(IInvocation invocation)
{
var type = invocation.InvocationTarget.GetType();
var methodName = type.Name;
StringBuilder parameters = new StringBuilder();
foreach (var item in invocation.GetConcreteMethod().GetParameters())
{
parameters.Append($"{item.Name},");
}
parameters.Remove(parameters.Length - 1, 1);
var argumentsValue = string.Join(",", invocation.Arguments);
}
Why don't you use Castle.DynamicProxy instead? See this example for instance.
hi . I'm using SimpleInjector in my project and I have an interceptor to Log Actions . I'm using DynamicProxy Like this Toturial
but now I need to get Method Signature Like below :
SimpleService.UserService.Void DoIt(System.String, Int32)(osman, 25)
how can I get this ? Thank you.