title: Silverlight linq-to-entities Anonymous type problem
body: <p>I am trying to work with silverlight, wcf data services ( on the website code) and Linq-to-Entities. I know that anonymous types don't work on silverlight then I created a known class in order to retrieve some information. (I know the query it is not exactly intelligent, but It is only an example) but It is not working. can somebody help me???</p>
  
  <p>this is the code.</p>
  
  <pre><code>public class DataSummary
  {
      public DataSummary() { }
  
      public int AccountID { get; set; }
  
      public string Account { get; set; }
  
      int accountID;
      string account;
  }
  
    var p = (from q in svc.Accounts
                   select new DataSummary()
                   { AccountID = (int) q.AccountID,
                     Account = q.Account1
                   }) as DataServiceQuery&lt;DataSummary&gt;;
  
          p.BeginExecute(new AsyncCallback(r =&gt;
          {
              try
              {
                  this.grid.ItemsSource = p.EndExecute(r).ToList();
              }
              catch (Exception ex)
              {
                  string message = ex.Message;
              }
          }), null);
  </code></pre>
  
  <p>when I run the example, the error message is</p>
  
  <pre><code>    ex.Message  "An error occurred while processing this request."  string
  </code></pre>
  
  <p>it is so funny, because it is not explaining the problem.</p>
  
  <p>Also in this question </p>
  
  <p><a href="https://stackoverflow.com/questions/2684954/silverlight-4-data-binding-with-anonymous-types">Silverlight 4 Data Binding with anonymous types</a></p>
  
  <p>they said that we can used anonymous types, but then how can I put the "as DataServiceQuery.......... ??</p>