title: CRM 2011 linq and saved query
body: <p>Is it possible to use CRM 2011 View (savedquery) with linq? I mean can I do something like this:</p>
  
  <pre><code>IEnumerable&lt;Opportunity&gt; GetOpportunites(CrmOrganizationServiceContext context, string viewName, Guid customerId)
  {
      var view = context.CreateQuery&lt;SavedQuery&gt;().FirstOrDefault(q =&gt; q.Name == viewName);
      if(view!=null)
         return from Opportunity op in view
             where op.CustomerId.Id == customerId
             select op;
             return new List&lt;Opportunity&gt;();
  }
  </code></pre>