Remove C# attribute of a property dynamically

后端 未结 5 1693
不思量自难忘°
不思量自难忘° 2020-11-30 09:18

I have a class with a set of properties As given below.

class ContactInfo
{
    [ReadOnly(true)]
    [Category(\"Contact Info\")]
    public string Mobile {          


        
5条回答
  •  忘掉有多难
    2020-11-30 10:00

    it's not possible at the moment to remove attributes dinamycally (at runtime)

    as a suggestion you can do 2 classes: one with the attributes and one without

提交回复
热议问题