Explicitly implemented interface’s properties usually starts with it’s interface’s full name. However if it is a nested interface, property’s name will be a bit mismatch.
namespace NS
{
public class Container
{
//FullName is NS.Container+ITest
public interface ITest
{
int Prop { get; }
}
}
public class Sample : Container.ITest
{
//Property's name is NS.Container.ITest.Prop
int Container.ITest.Prop { get; }
}
}
Why property’s name is not NS.Container+ITest.Prop? Or interface would better be named NS.Container.ITest. It would be more correct, isn’t it?
The type names that the CLR generates simply don’t match the naming conventions of the C# language. The canonical example is
List<int>, the CLR type name will resembleList'1(backquote). Which is not a valid type identifier in C#, just like NS.Container+ITest is not valid either.You need to use C# naming conventions in C# code.