Can I use the DataTables Editor with Entity Framework?

Can I use the DataTables Editor with Entity Framework?

yooakimyooakim Posts: 4Questions: 3Answers: 0

I would like to use the DataTable Editor to work with a EntityFramework DBContext. The constructor for Editor takes a DataTables.Database and I have this working just fine. But I have not been able to find any examples of how to use data from EntityFramework's DBContext.

Is that possible?

Any suggestions are much appreciated!

My end goals is to build a simple ASP.NET MVC 5 site with server-side processing and the data provided via Web API 2.

Cheers,
Joakim

Answers

  • allanallan Posts: 61,893Questions: 1Answers: 10,144 Site admin

    Hi Joakim,

    I'm afraid I don't have any examples of using Editor with EF at the moment. Due to the nature of EF its not trivial to be able to create an Editor instance in the same way as the API currently does (i.e. it needs to be able to dynamically construct the SQL required).

    The examples use WebAPI 2, but with an ADO.NET connection to the database.

    Do you have the DbConnection object that you used to create the DbContext (assuming it was created that way)? If so, you can use that to create an Editor Database class instance that Editor will work with (docs).

    Allan

  • yooakimyooakim Posts: 4Questions: 3Answers: 0

    Ok, thanks Allan. I'll play around with thisa bit more.

    DataTables and the Editor is great, thanks for making them! :-)

This discussion has been closed.