title: Convert DbContext to Datatable in Code first entity framework
body: <p>Hello I am trying to convert <code>DbContext</code> result to <code>DataTable</code>. I have one <code>class</code> i.e. <code>ClientTemplateModel</code> which <code>inherits</code> <code>DbContext</code>. In this class I have one <code>DbSet</code> object i.e. 
  <code>public virtual DbSet&lt;imagecomment&gt; ImageComments { get; set; }</code>.  I am using <strong>Code first entity framework</strong>.</p>
  
  <p>Here is my query.</p>
  
  <pre><code>using (ClientTemplateModel context = new ClientTemplateModel(connectionString))
  {
    var result = context.ImageComments.Where(p =&gt; p.Dcn == dcn).OrderByDescending(p =&gt; p.CommentsDateTime);
  }
  </code></pre>
  
  <p>Here I am want convert the <code>result</code> into <code>DataTable</code>. How can I convert this?</p>