Entity Framework with XML Files

.net c# entity-framework xml

Question

Can someone point me to a good tutorial explaining the Entity Framework using an XML file instead of a database? I have seen some good tutorials with SQL databases, but I can't make the leap to an XML file.

Thanks!

Accepted Answer

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.


Popular Answer

Linq to XML isn't all that much actually. I'd go with a serializable solution instead.



Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow