How to hide an inherited property in a class without modifying the inherited class (base class)?

前端 未结 10 1100
无人共我
无人共我 2020-11-27 20:21

If i have the following code example:

public class ClassBase
{
    public int ID { get; set; }

    public string Name { get; set; }
}

public class ClassA :         


        
10条回答
  •  死守一世寂寞
    2020-11-27 20:25

    You can use Browsable(false)

    [Browsable( false )]
    public override string Name
    {
        get { return base.Name; }
        set { base.Name= value; }
    }
    

提交回复
热议问题