Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework with XML file as the data source [duplicate]

Is there a method to use an XML file instead of a database in the Entity Framework?

like image 938
Tim Avatar asked Jan 20 '26 12:01

Tim


1 Answers

Entity Framework itself is provider-based, and is designed to operate over a relational database. If you really wanted to, you could write your own provider for EF that reads from/writes to an xml file, but it would be a huge amount of work.

I expect you should really be looking at one of:

  • LINQ-to-XML
  • XML (de)serialization
  • XPath/XQuery
  • XSLT

Entity Framework doesn't have a natural fit in this scenario.

like image 150
Marc Gravell Avatar answered Jan 23 '26 02:01

Marc Gravell