title: Entity Framework data annotation
body: <pre><code>public partial class SystemUser
  {
      [Display(Name = "User")]
      public string Username { get; set; }
      [Display(Name = "Pass")]
      public string Password { get; set; }
      public Nullable&lt;bool&gt; Type { get; set; }
  }
  </code></pre>
  
  <p>When query from database using this statement, data annotations are working fine:</p>
  
  <pre><code>context.SystemUsers.ToList();
  </code></pre>
  
  <p>but when I use 'new' keyword in my query, data annotation are automatically ignored.</p>
  
  <pre><code>context.SystemUsers.Select(u=&gt; new
  {
      u.Username,
      u.Type
  });
  </code></pre>
  
  <p>I want to use second query that I told and prevent from data annotaion ignore
  what's the solution?</p>