Entity Framework with XML files

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

Thank!

+43
c # xml entity-framework
Mar 03 '09 at 22:22
source share
6 answers

Entity Framework itself is based on the provider and is designed to work with a relational database. If you really want to, you can write your own provider for EF that reads / writes to the xml file, but it will be a huge job.

I expect that you really should look at one of:

  • LINQ to XML
  • XML Serialization (de)
  • XPath / XQuery
  • XSLT

Entity Framework does not have a natural fit for this scenario.

+41
Mar 03 '09 at 22:32
source share
— -

Linq for XML is not so much. Instead, I would take a serializable solution.

+3
03 Mar. '09 at 23:24
source share

I like LINQ to XSD: http://linqtoxsd.codeplex.com/

This is basically LINQ to XML with some classes derived from XSD to ensure that it conforms to the schema ...

+2
Apr 21 '10 at 1:02
source share

I do not think this is really possible.

From MSDN (my attention):

The ADO.NET Entity Framework is designed so that developers can create data access applications by programming against a conceptual model of an application instead of directly programming against a relational storage scheme.

0
Mar 03 '09 at 22:28
source share

You can use the oledb connection with the FORXML team ... but you will not have all the functions available with other providers ...

0
Jul 31 '10 at 21:09
source share
  • The problem is that you need file-based file storage? If so, you can use the SimpleDB data provider. SimpleDB is great if you need a relational database in a single file. MS Access is great for this.

  • XML is for communication. If used for storage, it is incredibly inefficient. It is best to break down two tasks and store your data in a relational database, and then generate your XML from your data.

0
Aug 26 '13 at 20:11
source share



All Articles