using System.Collections.Generic;
using System.Linq.Expressions;
public class AccountOwner
public string AccountOwnerName { get; set; }
public string AccountOwnerNumber { get; set; }
static string GetNameOf<T>(Expression<Func<T>> property)
return (property.Body as MemberExpression).Member.Name;
static string[] GetNameOf<T>(IEnumerable<Expression<Func<object>>> properties)
return properties.Select(GetNameOf).ToArray();
public static void Main(string[] args)
var x = new AccountOwner();
var listOfPropertyNames = GetNameOf<AccountOwner>(
new Expression<Func<object>>[]
() => x.AccountOwnerName,
() => x.AccountOwnerNumber
foreach (var property in listOfPropertyNames)
Console.WriteLine(property);