Entity Framework 6.1是否本地支持XML数据类型? [英] Does Entity Framework 6.1 support an XML data type natively?

查看:123
本文介绍了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 )是什么?实体框架是否支持集成到普通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.

Microsoft在EF4、5或6中有很长的往返线程

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.

您可以在此处阅读以下内容:

You can read that here:

https://social.msdn.microsoft.com/Forums/zh-CN/fb290076-f97d-41f4-9801-505ccf5ef1d6/entity-framework-and-sql-xml-data-type?forum=adodotnetentityframework

这篇关于Entity Framework 6.1是否本地支持XML数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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