title: LINQ select query with Anonymous type and user Defined type
body: <p>Anonymous class has read only properties in c#.  Which is often used to to declare in linq select query to get particular values from database.
  In my code I have the following query.The thing that confused me selecting new object of anonymous class using new statement. I had a model class of <code>StudentClerkshipsLogModel</code> . When I Use model name the query result allow editing.</p>
  
  <pre><code>var query = (from entity in _tblStudentClerkshipsLog.GetQueryable()
               where entity.StudentID == intStudentID                             
               select new StudentClerkshipsLogModel
               {
                   StudentClerkshipID = entity.StudentClerkshipID,
                   StudentID = entity.StudentID,
                   ClerkshipID = entity.ClerkshipID,
               }).ToList();
  </code></pre>
  
  <p>When I did not mention type after <code>new</code> in <code>select</code> statement I am unable to exit. compiler raise an error . enonymous object is read only.</p>
  
  <pre><code>var query = (from entity in _tblStudentClerkshipsLog.GetQueryable()
               where entity.StudentID == intStudentID                             
               select new 
               {
                   StudentClerkshipID = entity.StudentClerkshipID,
                   StudentID = entity.StudentID,
                   ClerkshipID = entity.ClerkshipID,
               }).ToList()
  </code></pre>
  
  <p>my question is how linq bind the about two query differently . Both queries have dynamic binding or first one is is static.</p>
  
  <p><strong>Thanks</strong>  </p>