when i want to have a base Interface and implement from it the call is ambiguous between the following methods or properties

Viewed 150

I know that the call is ambiguous between the following methods or properties and I know the meaning of this error but You see this implementation . I saw examples of each class being created on the interface, but I use the IOC.

 interface IOne
{
    void Save(string text);
}
interface ITwo
{
    void Save(string two);
}
class One : IOne
{
    public void Save(string text)
    {
        throw new NotImplementedException();
    }
}
class Two : ITwo
{
    public void Save(string two)
    {
        throw new NotImplementedException();
    }
}
interface IBase : IOne, ITwo
{

}
class Base : IBase
{
    void ITwo.Save(string two)
    {
        throw new NotImplementedException();
    }

    void IOne.Save(string text)
    {
        throw new NotImplementedException();
    }
}
class RunClass
{
    private readonly IBase _base;
    public RunClass(IBase @base)
    {
        this._base = @base;
    }

    public void SaveMethod(string t = "Test")
    {
        _base.Save(t);
    }

}

when i call this line _base.Save(t); i get this error the call is ambiguous between the following methods or properties. Is there a way to implement this type of implementation?

1 Answers
Related