MethodBoundaryAspect.Fody
MethodBoundaryAspect.Fody copied to clipboard
Q: Is there a way to apply this to all public and only public methods of type?
I want to do some post processing on every public method invocation of an aggregate. Is there a way to filter application of this? If I apply to a class level it gets invoked for all methods, even on properties.
Currently there is no possibility to filter for specific methods. This has to be implemented first.
Filters could then be:
Methodname via RegEx By accessibility modifier By type (method or property)
Another possibility would be to use the approach from PostSharp and CompileTimeValidate method. But this requires executing code from the aspect during weaving.
@epitka This may have been solved in v2.0.139 using the MulticastAttributes overload of the attribute. See src/MethodBoundaryAspect.Fody.UnitTests.TestAssembly.NetFramework/PublicMethodAttributeAspectMethods.cs for an example of how this works.
Acknowledging this old issue may no longer be of interest to you, if this is not what you're trying to accomplish, could you please provide a description of what you're wanting to do differently? Is it just property backing methods you want excluded?
Yes, I would like to exclude any properties methods. I wand to add some out-of-box tracing, and I only want user defined methods to be included in trace.