Hello I am trying to convert DbContext
result to DataTable
. I have one class
i.e. ClientTemplateModel
which inherits
DbContext
. In this class I have one DbSet
object i.e.
public virtual DbSet<imagecomment> ImageComments { get; set; }
. I am using Code first entity framework.
Here is my query.
using (ClientTemplateModel context = new ClientTemplateModel(connectionString))
{
var result = context.ImageComments.Where(p => p.Dcn == dcn).OrderByDescending(p => p.CommentsDateTime);
}
Here I am want convert the result
into DataTable
. How can I convert this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…