Is there a way to get the namespace of the target method? #35
-
Hello, I'm currently working on migrating tracing functionality over to Metalama, but I'm running into issues getting a fully-defined method name for the target method. As an example, here's some code:
Meanwhile, my Aspect code looks something like this (pulling from the docs):
What I expect/want to see is Is there a way to get the long form of the target at this time? My guess at what the solution may look like is to prepend the namespace to the method (hence my title) with code like Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can compose the fully qualified name as Alternatively, you can use |
Beta Was this translation helpful? Give feedback.
You can compose the fully qualified name as
$"{meta.Target.Method.DeclaringType.FullName}.{meta.Target.Method.Name}"
.Alternatively, you can use
meta.Target.Method.ToDisplayString()
. See https://doc.metalama.net/api/metalama_framework_code_idisplayable for details about optional parameters of this method.