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 数据类型?
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
