带有 XML 文件的实体框架 [英] Entity Framework with XML Files

查看:25
本文介绍了带有 XML 文件的实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我指出使用 XML 文件而不是数据库来解释实体框架的好教程吗?我看过一些很好的 SQL 数据库教程,但我无法跳到 XML 文件.

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.

谢谢!

推荐答案

实体框架本身是基于提供程序的,并且设计是为了在关系数据库上运行.如果您真的愿意,您可以为 EF 编写自己的提供程序来读取/写入 xml 文件,但这将是巨大的工作量.

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(反)序列化
  • XPath/XQuery
  • XSLT

实体框架自然不适合这种情况.

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

这篇关于带有 XML 文件的实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆