LINQ to SQL : Change in DataContext from Beta 1 to Beta 2

LINQ to SQL : Change in DataContext from Beta 1 to Beta 2

  • Comments 2

During the demonstration I have noticed that two major methods of DataContext has changed from Beta 1 to Beta 2.

 

First one, is the new name for the class DataShape(). Now there is no class called DataShape() but we have DataLoadOptions().

 

 

var loadOption = new DataLoadOptions();           

loadOption.LoadWith<Customer>(c => c.Orders);

 

db.LoadOptions = loadOption;

 

Secondly,

 

DataContext does not have any method called GetQueryText() it got changed to GetCommand().

 

Please let me know if you find something else. I will update this entry.

 

Namoskar!!!

Leave a Comment
  • Please add 6 and 5 and type the answer here:
  • Post
  • PingBack from http://www.artofbam.com/wordpress/?p=5043

  • I'm trying to load a table that referrences itself without deferred loading.

    I'm getting an exception of:

    System.InvalidOperationException was unhandled

     Message="Cycles not allowed in LoadOptions LoadWith type graph."

     Source="System.Data.Linq"

     StackTrace: ...

    The current code looks like:

    db.LoadOptions = new DataLoadOptions();

    db.LoadOptions.LoadWith<View>(v => v.View_Views);

    Is there a limitation with self-referrencing tables?

Page 1 of 1 (2 items)