I have such a class
[Description("This is a wahala class")]
public class Wahala
{
}
Is there anyway to get the content of the Description attribute for the Wahala class?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Absolutely – use
Type.GetCustomAttributes. Sample code:The same kind of code can retrieve descriptions for other members, such as fields, properties etc.