title: How to convert Anonymous Type to Strong Type from LINQ query
body: <p>I have written a LINQ query which returns a new type of class, becuse I have used GROUP BY. Therefore, I have created a new class to cast Anonymous type to Strong Type. Here is my LINQ...</p>
  
  <pre><code>var result = rpt
      .GroupBy(x =&gt; new
                    {
                        CreateTime = EntityFunctions.TruncateTime(x.CreatedTime),
                        x.UserId,
                        x.ProjectId
                    })
      .Select(x =&gt; new
                   {
                       UserId = x.Key.UserId,
                       ProjectId = x.Key.ProjectId,
                       CreateTime = x.Key.CreateTime,
                       TotalMinutesSpent = x.Sum(z =&gt; z.MinutesSpent)
                   })
      .OfType&lt;List&lt;UserTransactionReport&gt;&gt;().ToList();
  </code></pre>
  
  <p>My newly created class is like below...</p>
  
  <pre><code>public class UserTransactionReport
  {
      public int UserId { get; set; }
      public int ProjectId { get; set; }
      public DateTime CreateTime { get; set; }
      public int TotalMinutesSpent { get; set; }
  }
  </code></pre>
  
  <p>How can I convert this anonymous to strong?</p>