8using System.Collections.Generic;
9using System.Linq.Expressions;
17 public static class ExpressionExtensions
26 public static string GetKey<T>(
this Expression<T> expression)
28 var list =
new List<string>();
29 var member = expression.Body as MemberExpression;
30 while (member !=
null)
32 list.Insert(0, member.Member.Name);
33 member = member.Expression as MemberExpression;
35 return string.Join(
".", list);