问题描述
某些 RDBMS(包括 SQL Server)支持 XML 列.我不希望将这样的列映射到 string
数据类型.Entity Framework 6.1 是否以任何方式原生支持 XML?
Some RDBMSs (including SQL Server) support XML columns. I'd prefer not mapping such a column to the string
data type. Does Entity Framework 6.1 support XML natively in any way?
更具体地说,我能否将 xml
列映射到 .NET 的一种 XML 数据类型(例如 XElement
或 XmlElement
)?Entity Framework 是否支持集成到普通 LINQ 查询并转换为 SQL 查询的 XQuery?
More specifically, can I map an xml
column to one of the XML data types of .NET (such as XElement
or XmlElement
)? Does Entity Framework support XQuery that is integrated into normal LINQ queries and is translated to SQL queries?
推荐答案
不,只需将其映射为字符串,然后必须将其流式传输回 XML 文档.
No, only mapping it to string and then having to stream it back in to an XML document.
关于在 EF4、5 或 6 中执行此操作与 Microsoft 进行了很长的讨论,但看起来他们进行了研究并决定放弃.
There is a long thread back and forth with Microsoft about doing this in EF4, 5, or 6, but it looks like they researched it and decided to punt.
你可以在这里阅读:
https://social.msdn.microsoft.com/Forums/en-US/fb290076-f97d-41f4-9801-505ccf5ef1d6/entity-framework-and-sql-xml-data-type?forum=adodotnetentityframework
这篇关于Entity Framework 6.1 是否原生支持 XML 数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!