Skip to content

Intercepting methods called from within own class? #44

@grofit

Description

@grofit

I am not sure if this is a bug or not, but I have a class like so in a console app example:

public class SaySomethingAction : IAction
    {
        public virtual void Run()
        {
            Console.WriteLine("Type in what you want to say, then press enter");
            var message = Console.ReadLine();

            Say(message);
        }

        [DelayFor(2)]
        public virtual void Say(string message)
        {
            Console.WriteLine($"Saying {message}");
        }
    }

So my expectations is that when the Run method invokes Say it would trigger the DelayFor attribute (which is an InterceptAttribute), which would in turn call through to the relevant interceptor. However the interceptor associated with that attribute is not fired on Say, however if I were to put the [DelayFor(2)] onto the Run method, that WOULD correctly trigger and proxy the method.

So is this use case supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions