开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜