C# Property inheritance question
- by mcxiand
Hi all,
How do i inherit a property in c# from an interface and give that property other name on the class?
For example:
public interface IFoo
{
int Num {get;set;}
}
public class IFooCls : IFoo
{
int Ifoo.Num{get;set}
}
In this case, what the property name in the interface is also the same in the class. What i want is to give other property name on the class but still pointing to "Num" in the interface in this case. In VB, we can do it like this:
Public ReadOnly Property UserId() As String Implements System.Security.Principal.IIdentity.Name
Get
Return _userId
End Get
End Property