Let\'s say I have such interface and concrete implementation
public interface IMyInterface
{
T My();
}
public class MyConcrete : IMyInterface&l
Because your interface declares a generic method T My
, but you implementation does not implement a function with that specific signature.
To achieve what you want, you need to provide the T generic parameter to the interface instead, in your first example:
public interface IMyInterface2
{
T My();
}
public class MyConcrete2 : IMyInterface2
{
public string My()
{
throw new NotImplementedException();
}
}