<?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>Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx</link><description>In part 2 ,we will talk about how to use the client library to deal with : 1..N Associations This is the case of entities associated with each other 1..N . An example from Northwind is the relation between Categories and Products Entities. An instance</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Dew Drop - October 24, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9014671</link><pubDate>Fri, 24 Oct 2008 16:16:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9014671</guid><dc:creator>Dew Drop - October 24, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2008/10/24/dew-drop-october-24-2008/"&gt;http://www.alvinashcraft.com/2008/10/24/dew-drop-october-24-2008/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9131954</link><pubDate>Fri, 21 Nov 2008 18:23:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131954</guid><dc:creator>Daniel Portella</dc:creator><description>&lt;p&gt;Thank you for that, when in a vague term for time when would one be expecting a hotfix to come for the client library on deletion of links?&lt;/p&gt;</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9185259</link><pubDate>Mon, 08 Dec 2008 22:04:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9185259</guid><dc:creator>Adron</dc:creator><description>&lt;P&gt;This really eats at me. &amp;nbsp;Entity Framework is one of the only OR/Ms that doesn't manage relationships or state. &amp;nbsp;This really just gets at me. &amp;nbsp;I've seriously considered going back to NHibernate, LLBLGen, .netTiers, or some other more expansive, mature, and useful OR/M. &amp;nbsp;Microsoft with its vast resources should have really turned out a better product.&lt;/P&gt;
&lt;P&gt;...so far, rating == unhappy.&lt;/P&gt;</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9186152</link><pubDate>Tue, 09 Dec 2008 05:31:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9186152</guid><dc:creator>PhaniRajuYN</dc:creator><description>&lt;p&gt;Hi Adron, &lt;/p&gt;
&lt;p&gt;This post is about the client side context that we ship with Astoria . The Entity Framework sits on the Server-Side of an ADO.NET Data Service.&lt;/p&gt;
&lt;p&gt;That being said , we welcome feedback on how to make this easier for you in the next version .&lt;/p&gt;
&lt;p&gt;What kind of APIs would you like added to the client library to make your programming experience better ?&lt;/p&gt;
&lt;p&gt;Change the existing APIs to abstract away dealing with associations/links/Relations ?&lt;/p&gt;
&lt;p&gt;Add data binding support to entities materialized through the context ?&lt;/p&gt;
</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9258808</link><pubDate>Wed, 31 Dec 2008 22:01:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9258808</guid><dc:creator>PhaniRajuYN</dc:creator><description>&lt;p&gt;Hi Daniel ,&lt;/p&gt;
&lt;p&gt; The fix for deletion of links is published here :&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/default.aspx/kb/958481/"&gt;http://support.microsoft.com/default.aspx/kb/958481/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9398960</link><pubDate>Thu, 05 Feb 2009 19:14:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9398960</guid><dc:creator>Scott Prugh</dc:creator><description>&lt;P&gt;See my related question here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/33ba7ae3-eca7-44e3-a7fd-9dbc63fd8881" target=_new rel=nofollow&gt;http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/33ba7ae3-eca7-44e3-a7fd-9dbc63fd8881&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Basically we need better support for exposing the actual keys of realted entities for highly normalized table scenarios. &amp;nbsp;In would be nice to be able to include the foreign key ids directly in the main entity so that lookups can be cached on the client side and all relationships do not need to be expanded.&lt;/P&gt;</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9568664</link><pubDate>Sun, 26 Apr 2009 03:50:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9568664</guid><dc:creator>Phillip</dc:creator><description>&lt;P&gt;How do you edit related records and then save them? Here is the code that I tried but did not work:&lt;/P&gt;
&lt;P&gt;AdventureWorksEntities svc = new AdventureWorksEntities(new Uri("&lt;A href="http://localhost:54377/AWADONetService.svc%22" rel=nofollow target=_new&gt;http://localhost:54377/AWADONetService.svc"&lt;/A&gt;));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductCategory &amp;nbsp;category = svc.ProductCategory.Expand("ProductSubcategory").Where(r =&amp;gt; r.Name.StartsWith("Category 1")).First ();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;category.ProductSubcategory[0].Name = category.ProductSubcategory[0].Name + " changed";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;svc.SaveChanges(System.Data.Services.Client.SaveChangesOptions.Batch);&lt;/P&gt;</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9568765</link><pubDate>Sun, 26 Apr 2009 05:56:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9568765</guid><dc:creator>PhaniRajuYN</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt; You are missing a call to UpdateObject before calling SaveChanges&lt;/p&gt;
&lt;p&gt; svc.UpdateObject( category.ProductSubcategory[0] );&lt;/p&gt;
&lt;p&gt; svc.SaveChanges(System.Data.Services.Client.SaveChangesOptions.Batch);&lt;/p&gt;
&lt;p&gt;This should work&lt;/p&gt;
</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9569484</link><pubDate>Sun, 26 Apr 2009 20:03:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9569484</guid><dc:creator>Phillip</dc:creator><description>&lt;P&gt;Thanks Phani Raj. &amp;nbsp;This was very helpful. &amp;nbsp;Adding the svc.UpdateObject call solved the problem. &amp;nbsp;But I faced a couple of related problems.&lt;/P&gt;
&lt;P&gt;1- If I consume this service in silverlight application and call this query for a ProductCategory where there are no ProductSubCategories I get an error “Value cannot be null” at the step of calling the EndExecute within the AsyncCallback function. &amp;nbsp;I use this syntax for defining the query:&lt;/P&gt;
&lt;P&gt;DataServiceQuery&amp;lt;ProductCategory&amp;gt; qry = Context.ProductCategory.Expand("ProductSubCategory");&lt;/P&gt;
&lt;P&gt;2- When I added the service refrence to a Silverlight application using VS2008. I clicked on the Advanced button and indicated ObservableCollection where it says “Collection Type”. Yet the generated reference.cs class still shows the expended ProductSubCategories as System.Collections.ObjectModel.Collection. &amp;nbsp;I want to be able to bind the expended records to a datagrid that reflects any changes to the collection. &amp;nbsp;How to do this correctly?&lt;/P&gt;</description></item><item><title>re: Working with associations in ADO.NET Data Services , Part 2</title><link>http://blogs.msdn.com/phaniraj/archive/2008/10/23/working-with-associations-in-ado-net-data-services-part-2.aspx#9584398</link><pubDate>Sun, 03 May 2009 10:05:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9584398</guid><dc:creator>phillip</dc:creator><description>&lt;P&gt;I have been trying at the expand query but am still getting 2 errors: "Value Cannot be null" and "An Item with the same key has already been added". &amp;nbsp;I put here &amp;nbsp;a complete compressed project that reproduces the problems: &lt;A href="http://webswapp.com/categories/Silverlight/ADONET/ExpandQuery.aspx" rel=nofollow target=_new&gt;http://webswapp.com/categories/Silverlight/ADONET/ExpandQuery.aspx&lt;/A&gt;&lt;/P&gt;</description></item></channel></rss>