<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Relational-Object-XML-Object with LINQ to SQL &amp;amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx</link><description>This is old story and I have used parts of it over the last three years to show how LINQ lets you navigate from relational (R) to object (O) or object to XML (X) etc. But for a forthcoming demo, I had to write some quick code today and it looked like</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>a-foton &amp;raquo; Relational-Object-XML-Object with LINQ to SQL &amp;amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8782713</link><pubDate>Mon, 28 Jul 2008 09:00:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8782713</guid><dc:creator>a-foton &amp;raquo; Relational-Object-XML-Object with LINQ to SQL &amp;amp; LINQ to XML</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.a-foton.ru/2008/07/relational-object-xml-object-with-linq-to-sql-linq-to-xml/"&gt;http://blog.a-foton.ru/2008/07/relational-object-xml-object-with-linq-to-sql-linq-to-xml/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8784844</link><pubDate>Mon, 28 Jul 2008 19:53:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8784844</guid><dc:creator>LINQ Master</dc:creator><description>&lt;p&gt;Interesting solution. Might I suggest giving explanations of the abbreviations used, for people new to n-tier development?&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://blog.linqexchange.com&amp;quot;&amp;gt;LINQ"&gt;http://blog.linqexchange.com&amp;quot;&amp;gt;LINQ&lt;/a&gt; Exchange - Learn LINQ and Lambda Expressions&amp;lt;/a&amp;gt;&lt;/p&gt;</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8789388</link><pubDate>Tue, 29 Jul 2008 20:06:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8789388</guid><dc:creator>Dinesh.Kulkarni</dc:creator><description>&lt;p&gt;Sure thing LINQ Master! Just fixed the abbreviations. Thanks for the suggestion.&lt;/p&gt;
&lt;p&gt;BTW, I deliberately cut out some explanatory text. I would really like people to copy-paste (and change) the code and not spend too much time reading the non-code text. No amount of explanation can equal the understanding gained from working code adapter to your scenario.&lt;/p&gt;
</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8792042</link><pubDate>Wed, 30 Jul 2008 21:03:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8792042</guid><dc:creator>Ian Patrick Hughes</dc:creator><description>&lt;p&gt;Awesome. I was just trying right something like this the other day for building a navigation bar from a cached xml object! &lt;/p&gt;</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8833337</link><pubDate>Tue, 05 Aug 2008 10:22:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8833337</guid><dc:creator>Rolandas</dc:creator><description>&lt;p&gt;Why not just simply use XML serializer? It's more faster and the code becomes cleaner. Successfully done XML &amp;lt;-&amp;gt; Object &amp;lt;-&amp;gt; DB roundtrip. The only problem with LINQ is to get a KeyedCollection from ITable and EntitySet&amp;lt;T&amp;gt; keyed by the primary key (assuming only one primary key per table/view exists). Unfortunatelly, if XML contains updates of data, you need to have both DB data and your objects:&lt;/p&gt;
&lt;p&gt;table.Attach(newRows[primaryKey], oldRow);&lt;/p&gt;
&lt;p&gt;db.SubmitChanges();&lt;/p&gt;</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8838176</link><pubDate>Wed, 06 Aug 2008 20:14:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8838176</guid><dc:creator>Daniel Fisher (lennybacon)</dc:creator><description>&lt;p&gt;Any reason why you did not use the DataContractSerializer? You could do the same within 4 lines of code ...&lt;/p&gt;</description></item><item><title>re: Relational-Object-XML-Object with LINQ to SQL &amp; LINQ to XML</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/07/27/relational-object-xml-object-with-linq-to-sql-xml.aspx#8843539</link><pubDate>Fri, 08 Aug 2008 16:54:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8843539</guid><dc:creator>Dinesh.Kulkarni</dc:creator><description>&lt;p&gt;The comments about using one of the serializers (DC or XML) is valid for the specific code fragments posted above. The serializers are great if you want to move all public or DataMember annotated members. If you want more control (e.g. encrypt a member) or want to check things declaratively, then the approach above provides more options. &lt;/p&gt;
&lt;p&gt;But the main idea is to show you that LINQ to XML democratizes serializers. Writing one is a lot easier now than before.&lt;/p&gt;
&lt;p&gt;Same applies to O-&amp;gt;O mapping. You could have done that before too but now it is more declarative and compact.&lt;/p&gt;
</description></item></channel></rss>