“Add” extension method in Linq deprecated in VS 2008 RTM

Well, one of the "perks" of working in beta and switching to rtm is definitely the few surprises that come along. In VS 2008 Beta2 Linq entities had 'Add' method that allowed you to add an object to the current datacontext. Surprisingly, it is removed and renamed to 'InsertOnSubmit' on the RTM. It took me a while to figure that out, cause most of the stuff I had written previously was working fine. And I was so confident that my extention method had gone missing, that I started scouring through Reflector, instead of googling. Anyway, this info should help anyone, who's trying to hunt the add method. For disconnected updates however, attach method still exists.

Print | posted on Sunday, December 02, 2007 8:19 PM

Feedback

# re: “Add” extension method in Linq deprecated in VS 2008 RTM

Left by Will Asrari at 2/14/2008 1:29 PM
Gravatar I figured this out this morning as I had the same problem. FWIW, Remove has been refactored to "DeleteOnSubmit".

# re: “Add” extension method in Linq deprecated in VS 2008 RTM

Left by Darshit at 3/9/2008 10:54 PM
Gravatar Hi Rajbhandari!
You are right! I also searched for Add method as I read it in ScottGu's blogs! But finally I came to know that it is converted to datacontextname.InsertOnSubmit() and datacontextname.InsertAllOnSubmit()

Your comment:





 
Please add 7 and 5 and type the answer here:

Copyright © Bigyan Rajbhandari