How will you check the Public visibility of a property?

 Posted by Niladri.Biswas on 7/18/2012 | Category: C# Interview questions | Views: 2348 | Points: 40

By using the GetSetMethod method of the PropertyInfo .The method will return null if the getter/setter is non-public.

bool isPublicProperty = propertyInfo.GetSetMethod() != null;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response