Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Entity Framework 6.1 support an XML data type natively?

Tags:

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?

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?

like image 850
usr Avatar asked Aug 09 '14 14:08

usr


People also ask

Is XML a data type?

The xml data type is a built-in data type in SQL Server and is somewhat similar to other built-in types such as int and varchar. As with other built-in types, you can use the xml data type as a column type when you create a table as a variable type, a parameter type, a function-return type, or in CAST and CONVERT.

What all services does an Entity Framework provide?

The Entity Framework enables developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying database tables and columns where this data is stored.

Which of the subsequent platform helps EF core?

Cross-platform: EF Core is a cross-platform framework which can run on Windows, Linux and Mac.


1 Answers

No, only mapping it to string and then having to stream it back in to an XML document.

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/en-US/fb290076-f97d-41f4-9801-505ccf5ef1d6/entity-framework-and-sql-xml-data-type?forum=adodotnetentityframework

like image 172
Jeff Prince Avatar answered Oct 04 '22 03:10

Jeff Prince