I want to write common function which get all or single class property name
public class MyClass
{
public int TemplateId { get; set; }
public int TemplateCategoryId { get; set; }
}
Example: In other method I need to call
var propertyName = MyClass.TemplateId.GetPrertyName(); // will Return TemplateId
How can I make it?