title: RavenDB Linq Invalid Operation .ToUpperInvariant()
body: <p>I'm trying to use <code>ToUpperInvariant()</code> within a LINQ query with RavenDB. I'm getting an <strong>InvalidOperationException</strong>: </p>
  
  <blockquote>
    <p>Cannot understand how to translate server.Name.ToUpperInvariant().</p>
  </blockquote>
  
  <p>The query is below. What needs to happen in order for me to be able to match by name here? Is this possible within a query using RavenDB?</p>
  
  <pre><code>public ApplicationServer GetByName(string serverName)
  {
      return QuerySingleResultAndCacheEtag(session =&gt; session.Query&lt;ApplicationServer&gt;()
          .Where(server =&gt; server.Name.ToUpperInvariant() == serverName.ToUpperInvariant()).FirstOrDefault())
          as ApplicationServer;
  }
  
  protected static EntityBase QuerySingleResultAndCacheEtag(Func&lt;IDocumentSession, EntityBase&gt; func)
  {
      if (func == null) { throw new ArgumentNullException("func"); }
  
      using (IDocumentSession session = Database.OpenSession())
      {
          EntityBase entity = func.Invoke(session);
          if (entity == null) { return null; }
          CacheEtag(entity, session);
          return entity;
      }
  }
  </code></pre>