Skip to content

Add a way to access the returned value of the original method #53

@ascott18

Description

@ascott18

I need a way to receive the original return value of the underlying method, and then either keep that return value, mutate it, or replace it entirely with a different value.

Something to the effect of this:.

MethodInfo myMethod;
var plug = Nasal.InstanceMethod<MyReturn>(myMethod)
    .ReturnWrapped((object instance, MyReturn originalReturn, MyParam p1, MyParam p2) =>
    {
        // Do stuff, and either return `originalReturn` or some other value

        return ...
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions