I have a property in Myclass
:
public class MyClass{
public string FirstName {get;set;}
}
How can I get the PropertyInfo
(using GetProperty("FirstName")
) without a string?
Today I use this:
PropertyInfo propertyTitleNews = typeof(MyClass).GetProperty("FirstName");
Is there a way for use like this:
PropertyInfo propertyTitleNews = typeof(MyClass).GetProperty(MyClass.FirstName);
?