Microsoft Developer Network > Forums Home > Archived Forums Forums > LINQ Project General > Beta2 to RTM change: XML column default mapping changed to XElement instead of XDocument
Ask a questionAsk a question
 

General DiscussionBeta2 to RTM change: XML column default mapping changed to XElement instead of XDocument

  • Thursday, September 20, 2007 11:32 PMDinesh Kulkarni - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Another late-in-the-cycle change in LINQ to SQL that will be visible in RTM:

    In beta2, the default .NET type for mapping an XML column was LINQ to SQL's XDocument.

    In RTM, the default will be XElement.

     

    Reason: due to a late change in LINQ to XML, XDocument cannot be serialized with the DataContract serializer. XElement can still be serialized. We wanted to make sure that if you choose the serialization option in SqlMetal or designer, the resulting classes are indeed serializable. Hence, we have changed the default to XElement.

     

    However, you can still choose to use XDocument explicitly in the designer or by editing the dbml (or in your favorite editor or separate mapping tool). It is just not the default anymore.

     

    As before XML fragments that are not XElement/XDocument are not supported. There is no change in how the run-time handles XML columns. This is only a design-time change in LINQ to SQL.


    Thanks,
    Dinesh

     

    P.S. When moving from beta2 to RTM, please make sure that you regen the classes from your database/dbml using designer or SqlMetal. While we would have liked to maintain "generated source compatibility", that has not been possible in going from beta2 to RTM. I expect problems if code generated with beta2 is used against RTM version of System.Data.Linq.dll.

All Replies

  • Friday, September 21, 2007 5:07 AMJoe Rattz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for the alert Dinesh!

     

  • Saturday, March 01, 2008 4:48 PMAlexandre Brisebois Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have recently been trying to find information on how to query an xml typed column in sql 2005 using Linq to Sql and I have been having the hardest time finding any valuable information on the syntax. can anyone point me in the right direction ?

    best regards,
    Alexandre Brisebois
  • Thursday, January 08, 2009 4:37 PMAcadien Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Any development on this front? I am havign the same issue. I have put in a post question in EE and will postback if I get a solution. I the mean time if you have found one please let me know. Thanks in advance.