Skip to content

FeatureRequest, ActLike with possibility to map method names #26

@sjoerd222888

Description

@sjoerd222888

Hi

I think it is not yet possible what I would like to do. Let's assume I have

public class MyAdder{
    public double Add(double a, double b){
        return a + b;
    }
}

and an interface

public interface ISumCalculater{
    double Sum(double value1, double value2);
}

What I would like to be able to do is:

MyAdder adder = new MyAdder();
ISumCalculater calculator = adder.ActLike<ISumCalculater>().MapMethod("Add", "Sum");
double result = calculator.Sum(1.0, 2.0);

So I would like to have the possibility to have different method names in the interface and the implementation and still have the possibility to use ActLike<>. So I could use implementations which are compatible on the 'logical level' (however that should be called), but not on the naming level (which from a functional point of view is secondary; whether I call a car a "car", "voiture" or "автомобиль" does not change its behavior and functionality).

Now my question is whether this (by some way that I overlooked) is already possible in your library. If not then I would be interested to know whether this library could be extended to support that scenario (not only technically but also whether it would fit "the intention" of the library in your opinion).

Potentially this also interesting of course for properties.

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