private Expression <Func <T1, TKey> > GetKeySelector <T1, TKey>() { var key = MapperConfig.GetKeyMetas <T1>().SingleOrDefault(); if (key != null && key.Member != null && typeof(TKey).IsAssignableFrom(key.Member.GetMemberType())) { return(ExpressionHelper.CreateGetterExpression <T1, TKey>(key.Member));// key.Member.GetMemberProperty<T1, TKey>(); } return(null); }