Does Entity Framework 6.1 support an XML data type natively?(Entity Framework 6.1 是否原生支持 XML 数据类型?)
问题描述
某些 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 数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Entity Framework 6.1 是否原生支持 XML 数据类型?
基础教程推荐
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 如果条件可以为空 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 将数据集转换为列表 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
