<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Man vs Code</title><subtitle type="html">invaluable minutiae</subtitle><id>http://blogs.msdn.com/aconrad/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/aconrad/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-03-24T14:56:42Z</updated><entry><title>Peter Qian and row count</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/03/17/peter-qian-and-row-count.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2009/03/17/peter-qian-and-row-count.aspx</id><published>2009-03-18T04:51:20Z</published><updated>2009-03-18T04:51:20Z</updated><content type="html">&lt;p&gt;Peter Qian, the newest member of the ADO.NET Data Services, now has his own &lt;a href="http://blogs.msdn.com/peter_qian"&gt;blog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In his initial &lt;a href="http://blogs.msdn.com/peter_qian/archive/2009/03/18/getting-row-count-in-ado-net-data-services.aspx"&gt;post&lt;/a&gt;, Peter talks about the row count feature we included with v1.5 of ADO.NET Data Services.&amp;#160; He was one of the main designers and the implementer of this feature, so he knows what he is talking about.&amp;#160; What he doesn't know about quite yet is what happens when the community finds he owns the #1 customer ask for ADO.NET Data Services and he now has a blog.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9485871" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>updated Linq to Sql IUpdatable implementation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/03/17/updated-linq-to-sql-iupdatable-implementation.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2009/03/17/updated-linq-to-sql-iupdatable-implementation.aspx</id><published>2009-03-17T23:52:49Z</published><updated>2009-03-17T23:52:49Z</updated><content type="html">&lt;p&gt;Based on feedback from &lt;a href="http://www.robfe.com/"&gt;Robert Fonseca-Ensor&lt;/a&gt;, I have made a bunch of bug and performance fixes to the IUpdatable implementation for Linq to Sql and posted those to &lt;a href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;code gallery&lt;/a&gt;.&amp;#160; Rob is also now my first official contributor to the project.&lt;/p&gt;  &lt;p&gt;As part of ADO.NET Data Services v1.5 we have provided a new way to plug in data sources that provides the following features sorely missing from v1:&lt;/p&gt;  &lt;p&gt;1)&amp;#160; Does not require the data provider to provider CLR types representing the entities exposed by the data source.&amp;#160; This meta data can be provided dynamically at runtime (or even per query) via a new metadata interface and does not require any static typed entities.&lt;/p&gt;  &lt;p&gt;2)&amp;#160; Provides a much cleaner way for third party provider writers to write and ship stand alone ADO.NET Data Service providers.&amp;#160; (No more partial classes like my Linq to Sql IUpdatable implementation).&lt;/p&gt;  &lt;p&gt;In the coming days I will posting a walk through for converting the Linq to Sql IUpdateable implementation to a full blown Linq to Sql provider for ADO.NET Data Services to demonstrate the new interface.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9485207" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Astoria v1.5 CTP now available</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/03/17/astoria-v1-5-ctp-now-available.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2009/03/17/astoria-v1-5-ctp-now-available.aspx</id><published>2009-03-17T22:28:00Z</published><updated>2009-03-17T22:28:00Z</updated><content type="html">&lt;P&gt;In the fine tradition of &lt;A href="http://en.wikipedia.org/wiki/St._Patrick%27s_Day" mce_href="http://en.wikipedia.org/wiki/St._Patrick%27s_Day"&gt;Saint Patrick's Day&lt;/A&gt; we have released the first CTP of ADO.NET Data Services v1.5 today.&amp;nbsp; Download &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3e3d4eaf-227b-4ad3-ad0d-3613db8aa9df&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=3e3d4eaf-227b-4ad3-ad0d-3613db8aa9df&amp;amp;displaylang=en"&gt;here&lt;/A&gt;.&amp;nbsp; Team blog announcement and "Getting Started" walk through video &lt;A href="http://blogs.msdn.com/astoriateam/archive/2009/03/16/ado-net-data-services-v1-5-ctp1-now-available-for-download.aspx" mce_href="http://blogs.msdn.com/astoriateam/archive/2009/03/16/ado-net-data-services-v1-5-ctp1-now-available-for-download.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This is definitely a green release - with features like server driven paging and streaming blob support which will save you millions of server cycles.&amp;nbsp; We are planning on having several post on the team blogs explaining these and the rest of the v1.5 features soon.&amp;nbsp; Also probably some more of our design videos if I can get a spare moment...&lt;/P&gt;&lt;A href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.msdn.com%2fastoriateam%2farchive%2f2009%2f03%2f01%2fannouncing-ado-net-data-services-v1-5-ctp1.aspx"&gt;&lt;IMG border=0 alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.msdn.com%2fastoriateam%2farchive%2f2009%2f03%2f01%2fannouncing-ado-net-data-services-v1-5-ctp1.aspx"&gt;&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9484998" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author><category term="Astoria" scheme="http://blogs.msdn.com/aconrad/archive/tags/Astoria/default.aspx" /><category term="ADO.NET Data Services" scheme="http://blogs.msdn.com/aconrad/archive/tags/ADO.NET+Data+Services/default.aspx" /></entry><entry><title>VSlive Presentations and demos</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/03/04/vslive-presentations-and-demos.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="1354527" href="http://blogs.msdn.com/aconrad/attachment/9459359.ashx" /><id>http://blogs.msdn.com/aconrad/archive/2009/03/04/vslive-presentations-and-demos.aspx</id><published>2009-03-05T06:08:00Z</published><updated>2009-03-05T06:08:00Z</updated><content type="html">&lt;P&gt;Last week I presented two talks about ADO.NET Data Services at VSLive in San Francisco.&amp;nbsp; As promised to the talk attendees, here are the slides and demos.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9459359" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>OOB == Out of Band</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/03/02/oob-out-of-band.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2009/03/02/oob-out-of-band.aspx</id><published>2009-03-02T20:08:16Z</published><updated>2009-03-02T20:08:16Z</updated><content type="html">&lt;p&gt;Yesterday we announced that we will be releasing an update to ADO.NET Data Services that we are calling ADO.NET Data Services v1.5.&amp;#160; For more details, see Mike Flasko's write up &lt;a href="http://blogs.msdn.com/astoriateam/archive/2009/03/01/announcing-ado-net-data-services-v1-5-ctp1.aspx"&gt;here&lt;/a&gt; on the team blog.&lt;/p&gt;  &lt;p&gt;We should have a CTP out very soon.&amp;#160; I am personally very excited about having a ship vehicle that will allow us to ship quickly and hence get some new features out quickly (i.e. Row Count, Binding, Server Driven Paging, etc) to solve some key problems that we have heard about from the community.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now we just have to find some time to film a few more design videos...&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9455050" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Using timeout setting with Astoria client</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2009/01/13/using-timeout-setting-with-astoria-client.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2009/01/13/using-timeout-setting-with-astoria-client.aspx</id><published>2009-01-13T21:06:21Z</published><updated>2009-01-13T21:06:21Z</updated><content type="html">&lt;p&gt;Believe it or not, but we did ship ADO.NET Data Services with a few bugs.&amp;#160;&amp;#160;&amp;#160; One issue in particular is somewhat nasty.&amp;#160;&amp;#160; However the code developers might be tempted to write to work around the bug could cause far worse problems down the road when we fix the initial bug.&amp;#160; Hence I wanted to write a short post to describe the issue and give a quick sample of how to write code that &lt;b&gt;&lt;i&gt;will work now and in the future&lt;/i&gt;&lt;/b&gt; when we fix the issue.&lt;/p&gt;  &lt;p&gt;The problem exists in the ADO.NET Data Services client (System.Data.Services.Client.dll) we shipped with .NET 3.5 sp1 and Silverlight 2.0 SDK.&amp;#160; It also is a issue for developers using the &lt;a href="http://msdn.microsoft.com/en-us/library/dd179423.aspx"&gt;Windows Azure Table Storage API&lt;/a&gt; since that is built on top of the ADO.NET Data Services client.&lt;/p&gt;  &lt;p&gt;In particular, we do not throw the correct exception when a HTTP request has problems while being sent to the server.&amp;#160; I.e. a request timeouts, there is a bad server name, etc.&amp;#160; In other words, any problem that would normally raise a System.Net.WebException.&amp;#160; Unfortunately, in V1 of ADO.NET Data Services a NullReferenceException is raised instead of a WebException and even worse, the exception message is lost:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre class="csharpcode"&gt; DataServiceContext context = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataServiceContext(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;http://BadServer/Northwind.svc&amp;quot;&lt;/span&gt;));
 context.Timeout = 1; &lt;span class="rem"&gt;// Set small timeout amount to intentionally timeout request&lt;/span&gt;
 DataServiceQuery&amp;lt;Customer&amp;gt; query = context.CreateQuery&amp;lt;Customer&amp;gt;(&lt;span class="str"&gt;&amp;quot;Customers&amp;quot;&lt;/span&gt;);

 &lt;span class="kwrd"&gt;try&lt;/span&gt;
 {
     &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (Customer c &lt;span class="kwrd"&gt;in&lt;/span&gt; query) { }
 }
 &lt;span class="kwrd"&gt;catch&lt;/span&gt; (NullReferenceException nre)
 {
     &lt;span class="rem"&gt;// in V1, NullReferenceException is thrown instead of WebException.&lt;/span&gt;
     &lt;span class="rem"&gt;// Also, no useful description&lt;/span&gt;
     Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Something bad happened!&amp;quot;&lt;/span&gt;);
 }&lt;/pre&gt;

&lt;p&gt;We are planning on fixing this bug in a future version of ADO.NET Data Services client (both in .NET and Silverlight) so if your code relies exclusively on catching the NullReference exception, it will be broken when we ship the fix.&amp;#160; Hence, to make your code robust &amp;#8211; have your code explicitly catch both exception types:&lt;/p&gt;

&lt;pre class="csharpcode"&gt; DataServiceContext context = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataServiceContext(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;http://BadServer/Northwind.svc&amp;quot;&lt;/span&gt;));
 context.Timeout = 1;  &lt;span class="rem"&gt;// Set small timeout amount to intentionally timeout request&lt;/span&gt;
 DataServiceQuery&amp;lt;Customer&amp;gt; query = context.CreateQuery&amp;lt;Customer&amp;gt;(&lt;span class="str"&gt;&amp;quot;Customers&amp;quot;&lt;/span&gt;);

 &lt;span class="kwrd"&gt;try&lt;/span&gt;
 {
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (Customer c &lt;span class="kwrd"&gt;in&lt;/span&gt; query) { }
 }
 &lt;span class="kwrd"&gt;catch&lt;/span&gt; (WebException e)
 {
&lt;span class="rem"&gt;&lt;font color="#000000"&gt;     &lt;/font&gt;// When fix is shippped, will ADO.NET Data Services will correctly throw webException&lt;/span&gt;
     Console.WriteLine(e.Message);
 }
 &lt;span class="kwrd"&gt;catch&lt;/span&gt; (NullReferenceException nre)
 {
     &lt;span class="rem"&gt;// in V1, NullReferenceException is thrown instead of WebException.&lt;/span&gt;
     &lt;span class="rem"&gt;// Also, no useful description&lt;/span&gt;
     Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Something bad happened!&amp;quot;&lt;/span&gt;);
 }&lt;/pre&gt;

&lt;p&gt;We will update the team blog when we have a better idea of when the fix will be available.&amp;#160; All I can say now is we are looking into trying to get it out sooner than later, but we hope to have more information on this in the near future.&lt;/p&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9317139" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>MSDN Webcast: geekSpeak: Silverlight and ADO.NET Data Services with John Papa</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/12/16/msdn-webcast-geekspeak-silverlight-and-ado-net-data-services-with-john-papa.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/12/16/msdn-webcast-geekspeak-silverlight-and-ado-net-data-services-with-john-papa.aspx</id><published>2008-12-16T14:52:17Z</published><updated>2008-12-16T14:52:17Z</updated><content type="html">&lt;p&gt;On Wednesday &lt;a href="http://johnpapa.net/"&gt;John Papa&lt;/a&gt; will be giving a &lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032397110&amp;amp;Culture=en-US "&gt;webcast&lt;/a&gt; about anything and everything you ever wanted to know when consuming Astoria Data Services from a Silverlight 2.0 app.&amp;#160; Should be a good one.&lt;/p&gt;  &lt;p&gt;I also noticed that his &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0596523092/johnpanet-20"&gt;new book&lt;/a&gt; will be out January 2nd.&amp;#160; I have already preordered my copy.&amp;#160; I do wonder where O'Reilly is finding animals for the covers these days.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9226123" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>What is IUpdatable?  Why should I care?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/12/15/what-is-iupdatable-why-should-i-care.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/12/15/what-is-iupdatable-why-should-i-care.aspx</id><published>2008-12-15T22:59:05Z</published><updated>2008-12-15T22:59:05Z</updated><content type="html">&lt;p&gt;Over the past few weeks I have posted a couple of &lt;a href="http://blogs.msdn.com/aconrad/archive/2008/12/11/iupdateable-for-linq-to-sql-fixing-a-few-issues.aspx"&gt;samples&lt;/a&gt; of implementing IUpdateable for non-EF DALs so those can be used as data sources for ADO.NET Data Services.&amp;#160; A handful of people have asked me why this is interesting, so I now realize I should have given more background up front.&lt;/p&gt;  &lt;p&gt;Out of the box, the only DAL that gets read/ write behavior for free in ADO.NET Data Services is Entity Framework.&amp;#160; This is because internally in the ADO.NET Data Services bits, there is an implementation of an interface we call IUpdatable:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; System.Data.Services
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IUpdatable
    {
        &lt;span class="kwrd"&gt;void&lt;/span&gt; AddReferenceToCollection(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; resourceToBeAdded);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; ClearChanges();
        &lt;span class="kwrd"&gt;object&lt;/span&gt; CreateResource(&lt;span class="kwrd"&gt;string&lt;/span&gt; containerName, &lt;span class="kwrd"&gt;string&lt;/span&gt; fullTypeName);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource);
        &lt;span class="kwrd"&gt;object&lt;/span&gt; GetResource(IQueryable query, &lt;span class="kwrd"&gt;string&lt;/span&gt; fullTypeName);
        &lt;span class="kwrd"&gt;object&lt;/span&gt; GetValue(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveReferenceFromCollection(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; resourceToBeRemoved);
        &lt;span class="kwrd"&gt;object&lt;/span&gt; ResetResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; resource);
        &lt;span class="kwrd"&gt;object&lt;/span&gt; ResolveResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; resource);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; SaveChanges();
        &lt;span class="kwrd"&gt;void&lt;/span&gt; SetReference(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; propertyValue);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; SetValue(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; propertyValue);
    }
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The reason behind this interface is that when we were designing V1 of ADO.NET Data Services we wanted to the user to have the ability to plug in LINQ data sources(.e. Linq to Sql, Entity Framework, nHibernate, etc).&amp;#160; For read only access, this is really straight forward and general uniform across LINQ DALs.&amp;#160; All the data source has to expose is a type with public IQueryable&amp;lt;T&amp;gt; entry points for each of their EntitySets.&amp;#160; For write operations, it was a completely different story since there is no common API for updating LINQ based DALs.&amp;#160; So we invented IUpdateable.&lt;/p&gt;

&lt;p&gt;So any data source for Astoria that wants to support PUT, POST, and DELETE they must have an implementation of IUpdateable for their specific DAL. Hence why I started projects on Code Gallery to provide reference implementations of implementing IUpdatable for &lt;a href="http://code.msdn.microsoft.com/SubSonicForADONETDS"&gt;SubSonic&lt;/a&gt; and &lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=IUpdateableLinqToSql&amp;amp;ReleaseId=1753"&gt;Linq to Sql&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There actually are a few more smaller interfaces to implement to become a full fledge ADO.NET Data Service provider.&amp;#160; At some point in the near future, I will try to get a post up describing that stuff plus some preview of the refactoring we are doing in V2 of ADO.NET Data Services to make a nicer provider plugin model.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9222692" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Attention! Phani on Deck!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/12/12/attention-phani-on-deck.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/12/12/attention-phani-on-deck.aspx</id><published>2008-12-12T18:23:43Z</published><updated>2008-12-12T18:23:43Z</updated><content type="html">&lt;p&gt;One of the most common feature requests we hear for Astoria is the ability to mark properties on an entity as hidden.&amp;#160; Currently in V1 we support this on the server, but not with the .NET or Silverlight clients.&lt;/p&gt;  &lt;p&gt;Phani, resident Astoria hacker (and a really good tester), has written a very good &lt;a href="http://blogs.msdn.com/phaniraj/archive/2008/12/11/customizing-serialization-of-entities-in-the-ado-net-data-services-client-library.aspx"&gt;post&lt;/a&gt; on how you can roll your own override of client serialization behavior to support this functionality with the v1 clients.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9203030" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>IUpdateable for Linq to Sql - Fixing a few issues</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/12/11/iupdateable-for-linq-to-sql-fixing-a-few-issues.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/12/11/iupdateable-for-linq-to-sql-fixing-a-few-issues.aspx</id><published>2008-12-12T00:32:25Z</published><updated>2008-12-12T00:32:25Z</updated><content type="html">&lt;p&gt;Finally got IUpdateable.ResetResource() for Linq To Sql working correctly.&amp;#160; This means that REPLACE operations are now working correctly.&amp;#160; I have uploaded those changes to &lt;a href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;code gallery&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Going forward all changes to the code with be available exclusively on code gallery.&amp;#160; Also, I am trying to track known open issues there with the issue tracking capability.&lt;/p&gt;  &lt;p&gt;Finally, if anyone wants to be a contributor to this &lt;a href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;project&lt;/a&gt; or the SubSonic &lt;a href="http://code.msdn.microsoft.com/SubSonicForADONETDS"&gt;one&lt;/a&gt;, please let me know.&amp;#160; Particularly for the latter, there is some considerable work to do.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9199290" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Developing aN Astoria data provider for SubSonic</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/12/05/developing-an-astoria-data-provider-for-subsonic.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/12/05/developing-an-astoria-data-provider-for-subsonic.aspx</id><published>2008-12-05T18:37:43Z</published><updated>2008-12-05T18:37:43Z</updated><content type="html">&lt;p&gt;I have developed a data provider for &lt;a href="http://subsonicproject.com/"&gt;SubSonic&lt;/a&gt; to enable it as a ADO.NET Data Services data source. This ended up being a bit harder then I initially thought, and is definitely still a work in progress. If you are interested, I have started a &lt;a href="http://code.msdn.microsoft.com/SubSonicForADONETDS"&gt;code gallery project&lt;/a&gt; for it.&lt;/p&gt;  &lt;p&gt;I decided to base the first implementation of my provider on &lt;a href="http://blog.wekeroad.com/blog/subsonic-3-0-preview-2/"&gt;SubSonic 3.0 preview 2&lt;/a&gt;.&amp;#160; This is the first version of Sub Sonic that supports IQueryable&amp;lt;T&amp;gt; so getting read-only ADO.NET Data Service support over SubSonic is quite trivial. In fact, Jay Kimble has written a very nice post about how to do it &lt;a href="http://theruntime.com/blogs/jaykimble/archive/2008/11/18/quotsubsonicquot-for-services-found-subsonic-3--ado.net-data-services.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;To use my SubSonic Astoria data provider, first follow Jay&amp;#8217;s instructions to set up your SubSonic DAL.&amp;#160; This includs a very nice addition he has made to the SubSonic T4 templates to automatically add the Astoria attribute for Key properties.&lt;/p&gt;  &lt;p&gt;Next, down load the file SubSonicIUpdateable.cs class from the &lt;a href="http://code.msdn.microsoft.com/SubSonicForADONETDS"&gt;code gallery project&lt;/a&gt;. Add it into your project and make it a partial class with the same type as the DB type generated by SubSonic code gen:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; DB : IUpdatable&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Interestingly, SubSonic (at least version 3.0) doesn&amp;#8217;t really have a traditional O/R context type per se. In a way, this is practically a requirement for being a Astoria data source. Hence, my implementation utilizes a local context for each set of requests. Since this is only required to support scenarios required by IUpdateable, this was rather trivial to implement.&lt;/p&gt;

&lt;p&gt;A few known bugs/ issues with the initial code:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Binary fields support is currently not working. Hence inserting/ updating binary data is not happening. I think this is a SubSonic bug, but I need to spend some more cycles looking into it.&lt;/li&gt;

  &lt;li&gt;The IUpdateable implementation currently does not support batch mode. So even if the Astoria client is specifying batching, the DAL will send in the changes one at a time.&lt;/li&gt;

  &lt;li&gt;Only using SubSonic metadata to find primary key properties for a given type for concurrency checks. Probably should switch this to using Astoria metadata for this.&lt;/li&gt;

  &lt;li&gt;Identity values not working. I can&amp;#8217;t currently figure out how to get this to work with SubSonic 3.&lt;/li&gt;

  &lt;li&gt;I currently don&amp;#8217;t support relationships between entity types because that is not currently supported with the preview of SubSonic. &lt;/li&gt;

  &lt;li&gt;I will try to keep this up to date. Also, along with the code I have included the test project I use to test the implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One other interesting design issue that I discovered while implementing this is how Astoria Data Providers must be integrated at the source level. For example, what I really would like to do is implement something like SubSonicAstoriaProvidr&amp;lt;T&amp;gt; (where T is the DAL instance) and ship a assembly for that. With Astoria V1, that is next to impossible so one has to utilize something like partial classes to make this work. More to come on this later, but this has become one of the most important things we want to improve on in vNext.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9180477" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Slides for my ASP.NET Connections Sessions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/11/11/slides-for-my-asp-net-connections-sessions.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="3984932" href="http://blogs.msdn.com/aconrad/attachment/9059583.ashx" /><id>http://blogs.msdn.com/aconrad/archive/2008/11/11/slides-for-my-asp-net-connections-sessions.aspx</id><published>2008-11-11T09:16:00Z</published><updated>2008-11-11T09:16:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;As promised the slides &amp;amp; demos&amp;nbsp;for my two&amp;nbsp;ASP.NET Connections talks&amp;nbsp;from 11/11/08:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MDA01: Deep Dive: ADO.NET Data Services Framework—Application Patterns&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MDA04: LINQ to XML, SQL, Entities, DataSets and Co.: Data Access Technologies Explained&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;- AKA Linq to Anything&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;STRONG&gt;&lt;EM&gt;Update: 11/12/08 - download now includes all demos including Linq to Twitter, PetBook, and my LINQ samples from our LINQ to Anything (MDA04) talk.&amp;nbsp; Will update again with Shyam's demos from LINQ&amp;nbsp;to Anything&amp;nbsp;sometime in the next few days.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9059583" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author><category term="ADO.NET Data Services" scheme="http://blogs.msdn.com/aconrad/archive/tags/ADO.NET+Data+Services/default.aspx" /></entry><entry><title>IUpdateable for Linq To Sql</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/11/05/iupdateable-for-linq-to-sql.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/11/05/iupdateable-for-linq-to-sql.aspx</id><published>2008-11-06T04:52:00Z</published><updated>2008-11-06T04:52:00Z</updated><content type="html">&lt;p&gt;IUpdatable for Linq to Sql&lt;/p&gt;  &lt;p&gt;I have had an implementation of IUpdateable for Linq to Sql about half done for quite some time now. Yesterday I decided to bite the bullet and finish it up.&lt;/p&gt;  &lt;p&gt;Below I have included that code. I&amp;#8217;ve done some light testing, but I am sure there are some bugs &amp;#8211; and perhaps some perf fixes that can be made. My plan is to get this out on CodePlex as soon as I get a moment.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;#160;&lt;strong&gt;Update - 11/06/08, I actually ended up putting it on CodeGallery &lt;/strong&gt;&lt;/em&gt;&lt;a class="" href="http://code.msdn.microsoft.com/IUpdateableLinqToSql" mce_href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;&lt;strong&gt;&lt;em&gt;here&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Update 2 - 12/02/08, I found I had implemented ResetResource incorrectly to set the property values to the original values instead of the default values.&amp;#160; Fixed this and uploaded the file to &lt;a href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;CodeGallery&lt;/a&gt;.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Update 3 - 12/11/08 - Found another set of fixes for ResetResource.&amp;#160; Fixed this and uploaded the file to &lt;a href="http://code.msdn.microsoft.com/IUpdateableLinqToSql"&gt;CodeGallery&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Note: Going forward all updates to the code will be exclusively on Code Gallery and will not posted to this blog.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A couple of notes about this code:&lt;/p&gt;  &lt;p&gt;1) I haven&amp;#8217;t implemented ClearChanges() yet. As far as I can tell there is really no straight forward to do this with Linq to Sql. It isn&amp;#8217;t that big of deal because ClearChanges is only required by Astoria when processing batches with multiple ChangeSets. Something that is not supported by the Astoria .NET client.&lt;/p&gt;  &lt;p&gt;2) The easiest way to use this is to define a partial class for your DataContext type and provide the implementation there. i.e. &lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;pre style="font-size: 12px; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; background-color: #ffffff"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; partial &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; nwDataContext : IUpdatable&lt;/pre&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;That way you don&amp;#8217;t need to change your generated context class.&lt;/p&gt;

&lt;p&gt;Next step - implementing IExpandProvider&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; myDataContext : IUpdatable
    {
        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Creates the resource of the given type and belonging to the given container&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;containerName&amp;quot;&amp;gt;container name to which the resource needs to be added&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;fullTypeName&amp;quot;&amp;gt;full type name i.e. Namespace qualified type name of the resource&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;object representing a resource of given type and belonging to the given container&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; CreateResource(&lt;span class="kwrd"&gt;string&lt;/span&gt; containerName, &lt;span class="kwrd"&gt;string&lt;/span&gt; fullTypeName)
        {
            Type t = Type.GetType(fullTypeName);
            Debug.Assert(t != &lt;span class="kwrd"&gt;null&lt;/span&gt;);  &lt;span class="rem"&gt;// assume can find type&lt;/span&gt;
            ITable table = (ITable)&lt;span class="kwrd"&gt;this&lt;/span&gt;.GetType().GetProperty(containerName).GetValue(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            &lt;span class="kwrd"&gt;object&lt;/span&gt; resource = Activator.CreateInstance(t);
            table.InsertOnSubmit(resource);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; resource;
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Gets the resource of the given type that the query points to&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;query&amp;quot;&amp;gt;query pointing to a particular resource&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;fullTypeName&amp;quot;&amp;gt;full type name i.e. Namespace qualified type name of the resource&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;object representing a resource of given type and as referenced by the query&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; GetResource(IQueryable query, &lt;span class="kwrd"&gt;string&lt;/span&gt; fullTypeName)
        {
            &lt;span class="kwrd"&gt;object&lt;/span&gt; resource = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;object&lt;/span&gt; o &lt;span class="kwrd"&gt;in&lt;/span&gt; query)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (resource != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                {
                    &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Expected a single response&amp;quot;&lt;/span&gt;);
                }
                resource = o;
            }

            &lt;span class="rem"&gt;// fullTypeName can be null for deletes&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (fullTypeName != &lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; resource.GetType() != Type.GetType(fullTypeName))
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Unexpected type for resource&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; resource;
        }&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Resets the value of the given resource to its default value&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;resource&amp;quot;&amp;gt;resource whose value needs to be reset&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;same resource with its value reset&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; ResetResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; resource)
        {
            Type t = resource.GetType();
            Debug.Assert(t != &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            &lt;span class="kwrd"&gt;object&lt;/span&gt; newResource = Activator.CreateInstance(t);
            MetaTable table = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Mapping.GetTable(t);
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var member &lt;span class="kwrd"&gt;in&lt;/span&gt; table.RowType.IdentityMembers)
            {
                &lt;span class="kwrd"&gt;object&lt;/span&gt; keyValue = member.MemberAccessor.GetBoxedValue(resource);
                member.MemberAccessor.SetBoxedValue(&lt;span class="kwrd"&gt;ref&lt;/span&gt; newResource, keyValue);
            }
            &lt;span class="kwrd"&gt;return&lt;/span&gt; newResource;
        }&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;pre class="csharpcode"&gt;        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Sets the value of the given property on the target object&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;target object which defines the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyName&amp;quot;&amp;gt;name of the property whose value needs to be updated&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyValue&amp;quot;&amp;gt;value of the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetValue(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; propertyValue)
        {
            PropertyInfo pi = targetResource.GetType().GetProperty(propertyName);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (pi == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Can't find property&amp;quot;&lt;/span&gt;);
            pi.SetValue(targetResource, propertyValue, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Gets the value of the given property on the target object&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;target object which defines the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyName&amp;quot;&amp;gt;name of the property whose value needs to be updated&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;the value of the property for the given target resource&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; GetValue(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName)
        {
            PropertyInfo pi = targetResource.GetType().GetProperty(propertyName);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (pi == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Can't find property&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; pi.GetValue(targetResource, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Sets the value of the given reference property on the target object&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;target object which defines the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyName&amp;quot;&amp;gt;name of the property whose value needs to be updated&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyValue&amp;quot;&amp;gt;value of the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SetReference(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; propertyValue)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.SetValue(targetResource, propertyName, propertyValue);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Adds the given value to the collection&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;target object which defines the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyName&amp;quot;&amp;gt;name of the property whose value needs to be updated&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;resourceToBeAdded&amp;quot;&amp;gt;value of the property which needs to be added&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AddReferenceToCollection(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; resourceToBeAdded)
        {
            PropertyInfo pi = targetResource.GetType().GetProperty(propertyName);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (pi == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Can't find property&amp;quot;&lt;/span&gt;);
            IList collection = (IList) pi.GetValue(targetResource, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            collection.Add(resourceToBeAdded);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Removes the given value from the collection&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;target object which defines the property&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;propertyName&amp;quot;&amp;gt;name of the property whose value needs to be updated&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;resourceToBeRemoved&amp;quot;&amp;gt;value of the property which needs to be removed&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveReferenceFromCollection(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource, &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName, &lt;span class="kwrd"&gt;object&lt;/span&gt; resourceToBeRemoved)
        {
            PropertyInfo pi = targetResource.GetType().GetProperty(propertyName);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (pi == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;Can't find property&amp;quot;&lt;/span&gt;);
            IList collection = (IList)pi.GetValue(targetResource, &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            collection.Remove(resourceToBeRemoved);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Delete the given resource&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;targetResource&amp;quot;&amp;gt;resource that needs to be deleted&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; DeleteResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; targetResource)
        {
            ITable table = &lt;span class="kwrd"&gt;this&lt;/span&gt;.GetTable(targetResource.GetType());
            table.DeleteOnSubmit(targetResource);
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Saves all the pending changes made till now&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SaveChanges()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.SubmitChanges();
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Returns the actual instance of the resource represented by the given resource object&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;param name=&amp;quot;resource&amp;quot;&amp;gt;object representing the resource whose instance needs to be fetched&amp;lt;/param&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;returns&amp;gt;The actual instance of the resource represented by the given resource object&amp;lt;/returns&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; ResolveResource(&lt;span class="kwrd"&gt;object&lt;/span&gt; resource)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; resource;
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Revert all the pending changes.&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ClearChanges()
        {
        }
    }&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode {
	font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff
}
.csharpcode pre {
	font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff
}
.csharpcode pre {
	margin: 0em
}
.csharpcode .rem {
	color: #008000
}
.csharpcode .kwrd {
	color: #0000ff
}
.csharpcode .str {
	color: #006080
}
.csharpcode .op {
	color: #0000c0
}
.csharpcode .preproc {
	color: #cc6633
}
.csharpcode .asp {
	background-color: #ffff00
}
.csharpcode .html {
	color: #800000
}
.csharpcode .attr {
	color: #ff0000
}
.csharpcode .alt {
	margin: 0em; width: 100%; background-color: #f4f4f4
}
.csharpcode .lnum {
	color: #606060
}&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9046853" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Linq to anything</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/10/30/linq-to-anything.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/10/30/linq-to-anything.aspx</id><published>2008-10-31T04:12:00Z</published><updated>2008-10-31T04:12:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Along with my manager &lt;A class="" href="http://blog.pather.net/" mce_href="http://blog.pather.net/"&gt;Shyam Pather&lt;/A&gt;, I am giving the following talk at the upcoming &lt;A class="" href="http://www.devconnections.com/" mce_href="http://www.devconnections.com/"&gt;Dev Connections conference&lt;/A&gt;:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;MDA04:&amp;nbsp;LINQ to XML, SQL, Entities, DataSets and Co.: Data Access Technologies Explained&lt;/SPAN&gt;&lt;/B&gt;&lt;BR&gt;&lt;FONT size=3&gt;With the release of the Microsoft .NET Framework 3.5, Microsoft introduced several new data access technologies based on its LINQ technology, such as LINQ to SQL and LINQ to DataSets. Shortly after, we expect Microsoft to release the ADO.NET Entity Framework which enables LINQ to Entities in addition to Entity SQL. Finally, we have all the existing ADO.NET data access patterns. This raises one important question: Which data access technology is best suited for which situation? In this session, we look at different scenarios and requirements that can inform your technology decision.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;As part of this talk, we are trying to give as many Linq demos as possible.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So far&amp;nbsp;we have:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Entities&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to DataSet&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to ADO.NET Data Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Windows Azure Storage&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Linq to Sql Data Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Plus a few surprises.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;I am looking at something real esoteric to write a Linq provider.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So if anyone has any ideas, please leave a comment or email me.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9025903" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry><entry><title>Astoria team is hiring!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/aconrad/archive/2008/03/24/astoria-team-is-hiring.aspx" /><id>http://blogs.msdn.com/aconrad/archive/2008/03/24/astoria-team-is-hiring.aspx</id><published>2008-03-24T21:56:42Z</published><updated>2008-03-24T21:56:42Z</updated><content type="html">&lt;p&gt;The Astoria team is hiring!  &lt;p&gt;We have positions open for Developers and Program Managers.&amp;nbsp; Currently, we are finishing up V1 and planning for V2, so it is a great time to join the team.&amp;nbsp; For V2, we are thinking about expanding the project into new areas (e.g. offline support, sync, dynamic language support) so there will be plenty of new and exciting work.  &lt;p&gt;Please forward your resume to &lt;a href="mailto:aconrad@microsoft.com"&gt;aconrad@microsoft.com&lt;/a&gt; if you’re interested.&amp;nbsp; The project covers a diverse set of technical areas (databases, Linq, O/R, REST, etc) so we value passion for the technology more than deep expertise in any particular area. The Astoria team uses an agile development model, so the project moves fast and we encourage individuals to take on a variety of roles and responsibilities. If you’re a developer who wants to be responsible for more than just coding (i.e. API design, specification writing, working with customers and partners) this team is the place for you!  &lt;p&gt;And finally, team members must be willing to participate in the grueling Team Astoria &lt;a href="http://blogs.msdn.com/astoriateam/archive/2008/01/25/resting-on-the-slopes.aspx"&gt;off-site events&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Update 4/23/08 - As of the start of this week, we now have a block of additional new positions on the Astoria Team we need to fill.&amp;nbsp; These include development, program management, and quality assurance positions.&amp;nbsp; We are trying to fill these very quickly, so if you are interested please contact us soon.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8334367" width="1" height="1"&gt;</content><author><name>aconrad</name><uri>http://blogs.msdn.com/members/aconrad.aspx</uri></author></entry></feed>