title: Can C# nameof operator reference instance property without instance?
body: <p>I regularly want to get the name of an instance property of a type, when I have no instance. Currently to do this, I use the following inhouse function which interprets the <code>Expression[Func[T, object]]</code> parameter and returns the property name:</p>
  
  <pre><code>var str = LinqExtensions.NameOf&lt;ClientService&gt;(x =&gt; x.EndDate);
  // Now str == "EndDate"
  </code></pre>
  
  <p>However it seems a shame not to use the built in <code>nameof</code> operator.</p>
  
  <p>Unfortunately it seems that the <code>nameof</code> operator requires either an instance, or, to reference a static properties.</p>
  
  <p>Is there a neat way to use the <code>nameof</code> operator instead of our in house function? For example:</p>
  
  <pre><code>nameof(ClientService.EndDate) // ClientService.EndDate not normally syntactically valid as EndDate is instance member
  </code></pre>
  
  <p>EDIT</p>
  
  <p>I was completely wrong, the syntax <code>nameof(ClientService.EndDate)</code> as described actually works as is.</p>