title: how can i write a generic query with EF and C#
body: <p>i want to write a query in entity framework like this:</p>
  
  <pre><code>T entity = (from e in myContext.typeof(T) )
  </code></pre>
  
  <p>i tried to use string concat but this dose not work for get a member from <code>myContext</code></p>
  
  <p>more code:</p>
  
  <pre><code>public T GetEntity&lt;T&gt;(Guid entityId, string connectionString)
  {
      using (RContext rpContext = new RContext(connectionString))
      {
  
          var entity = (from e in rpContext.Set&lt;T&gt;()
                                      where e.Id == entityId
                                      select e).FirstOrDefault();
                      return (T) Convert.ChangeType(entity, typeof(T));
  
      }
  }
  </code></pre>