title: How to get single column with LINQ in anonymous method
body: <p>How to get single column with anonymous method using linq expression. Here's my code and it doesn't work:</p>
  
  <pre><code>public IEnumerable&lt;object&gt; GetPropertyValues&lt;T&gt;(string propName) where T : class
  {
      return base.Query&lt;T&gt;().AsEnumerable()
          .Where(x =&gt; x.GetType().GetProperty(propName).Name == propName)
          .Select(x =&gt; x.GetType().GetProperty(propName).GetValue(x, null));
  }
  </code></pre>
  
  <p>Here's the code in non generic method: </p>
  
  <pre><code>base.Query&lt;Product&gt;().Select(x =&gt; x.ProductName).AsEnumerable();
  </code></pre>
  
  <p>Thanks in advance.</p>