Karlen Sahakyan

Karlen Sahakyan

  • NA
  • 47
  • 4.6k

C# basics (ATTRIBUTES )

Jun 24 2019 2:34 AM
HELLO!!!
I have custom attribute
 
[AttributeUsage(AttributeTargets.Property)]
public class TestAttribute : Attribute
{
public string S;
public TestAttribute()
{
}
}
public class A
{
[Test]
public string str { get; set; }
}
How can I get value of properti in my attribute where i use my attribute?
For example i use my attribute for str properti how can i get str value in my TestAttribute Class? 

Answers (3)