开发者

Sql Server xml column with Entity Framework - how to keep insignificant whitespaces

开发者 https://www.devze.com 2022-12-24 07:45 出处:网络
Sql server 2005 (even 2008) strips the insignificant whitespaces by default.To keep one can use the CONVERT fu开发者_JAVA百科ntction with the last argument as \'1\' (Ref. Article).How can we do the sa

Sql server 2005 (even 2008) strips the insignificant whitespaces by default. To keep one can use the CONVERT fu开发者_JAVA百科ntction with the last argument as '1' (Ref. Article). How can we do the same thing in Entity Framework?

thanks


I found a workaround for the problem. You can set the xml attribute 'xml:space=preserve" at the document level. Both Sql server 2005 and 2008 respect the attribute setting and keep the whitespaces. it was a pleasant surprise. Unfortunately, MSDN documentation does not explicitly say this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号