Entity Framework Sql XML Column - How to Keep Minor Spaces

Sql server 2005 (even 2008) by default ignores non-essential spaces. To save, you can use the CONVERT function with the last argument as '1' ( Link to the article ). How can we do the same in the Entity Framework?

thanks

+4
source share
1 answer

I found a workaround for the problem. You can set the xml: space = preserve attribute at the document level. Both Sql 2005 and 2008 servers correspond to the attribute setting and retain spaces. It was a pleasant surprise. Unfortunately, this is not explicitly stated in the MSDN documentation.

+3
source

Source: https://habr.com/ru/post/1305485/


All Articles