<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arun Stephens &#187; .net</title>
	<atom:link href="http://blog.arunstephens.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.arunstephens.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 11 Aug 2011 20:55:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Azure 1.3, Rewrite module and a &#8216;Faulted&#8217; System.ServiceModel.Channels.ServiceChannel</title>
		<link>http://blog.arunstephens.com/2011/01/07/azure-1-3-rewrite-faulted-servicechanne/</link>
		<comments>http://blog.arunstephens.com/2011/01/07/azure-1-3-rewrite-faulted-servicechanne/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 10:32:42 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://blog.arunstephens.com/?p=340</guid>
		<description><![CDATA[I recently updated to Azure SDK 1.3. Then I tried to debug my solution locally. This is where the trouble began. The problem was that I was using the IIS Rewrite module without having it installed. Rewrite was part of &#8230; <a href="http://blog.arunstephens.com/2011/01/07/azure-1-3-rewrite-faulted-servicechanne/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently updated to Azure SDK 1.3. Then I tried to debug my solution locally. This is where the trouble began. The problem was that I was using the IIS Rewrite module without having it installed. Rewrite was part of Azure SDK 1.2, but it has to be installed separately for 1.3. I guess I should have read the release notes.</p>
<p>Here is what the problem was, and how I found the solution.</p>
<p>I would consistently get the following exception:</p>
<p><code>System.ServiceModel.CommunicationObjectFaultedException was unhandled<br />
  Message=The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.<br />
  Source=mscorlib<br />
  StackTrace:<br />
    Server stack trace:<br />
       at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)<br />
    Exception rethrown at [0]:<br />
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&#038; msgData, Int32 type)<br />
       at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)<br />
       at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)<br />
       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)<br />
  InnerException:</code></p>
<p>It didn&#8217;t make any sense.</p>
<p>Most of the support out there (like <a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/fc60cd6d-1df9-47ff-90a8-dd8d5de1f080">here</a>) suggested that it was because I was using a <tt>using (...) { }</tt> block around a <tt>ServiceClient</tt>. Something about exceptions that get raised during the <tt>ServiceClient</tt>&#8216;s <tt>Close</tt> method being swallowed up into that generic one. But it wasn&#8217;t that. My code didn&#8217;t consume any WCF services.</p>
<p>I thought it might have been the Facebook SDK. It couldn&#8217;t have been log4net or Netwonsoft.JSON, either.</p>
<p>Another suggestion was that WebRole&#8217;s <a href="http://social.msdn.microsoft.com/Forums/eu/windowsazuretroubleshooting/thread/26165c71-f941-4d84-9ef3-649d7bab0066">Web.config file was not writeable</a>. That wasn&#8217;t the case either.</p>
<p>It turns out it was the use of the <rewrite> section in Web.config. What also didn&#8217;t help was that I had two <connectionStrings> sections by mistake as well (the result of a bad merge). According to the <a href="http://msdn.microsoft.com/en-us/library/gg465715.aspx#IIS">Windows Azure SDK Release Notes</a>, &#8220;If you wish to use the IIS URL Rewrite module, you must install it and configure your rewrite rules.&#8221;</p>
<p>Once I installed that, I was able to run my solution with the Rewrite rules intact.</p>
<p>I suspected that the problem wasn&#8217;t really that the IIS Rewrite module hadn&#8217;t been installed, but that the unrecognised Web.config section caused it to fall down. That suspicion was confirmed when I added a <foo /> element to my Web.config. The exact same CommunicationObjectFaultedException was raised.</p>
<p>So the golden rule is to your Web.config if you get a CommunicationObjectFaultedException when running an Azure solution locally.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2011/01/07/azure-1-3-rewrite-faulted-servicechanne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entity Framework 4 many-to-many</title>
		<link>http://blog.arunstephens.com/2010/03/10/entity-framework-4-many-to-many/</link>
		<comments>http://blog.arunstephens.com/2010/03/10/entity-framework-4-many-to-many/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:04:56 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[entity-framework]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://blog.arunstephens.com/2010/03/10/entity-framework-4-many-to-many/</guid>
		<description><![CDATA[I had another problem with EF4 today. Code that worked fine in .NET 3.5 didn’t work after I regenerated the entity model using Visual Studio 2010. I found an answer, again on Stack Overflow: http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework It turns out that the &#8230; <a href="http://blog.arunstephens.com/2010/03/10/entity-framework-4-many-to-many/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had another problem with EF4 today. Code that worked fine in .NET 3.5 didn’t work after I regenerated the entity model using Visual Studio 2010.</p>
<p>I found an answer, again on Stack Overflow: <a href="http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework">http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework</a></p>
<p>It turns out that the generator decided that one of my foreign keys in an associative table should have a StoredGeneratorPattern of Identity, meaning it thought it was an identity column. When it isn’t.</p>
<p>But updating the XML as suggested in the answer above fixed it. So that’s good.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2010/03/10/entity-framework-4-many-to-many/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1..0 or 1 relationships in Entity Framework</title>
		<link>http://blog.arunstephens.com/2010/03/09/1-0-or-1-relationships-in-entity-framework/</link>
		<comments>http://blog.arunstephens.com/2010/03/09/1-0-or-1-relationships-in-entity-framework/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 23:49:32 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[entity-framework]]></category>
		<category><![CDATA[foreign key]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://blog.arunstephens.com/2010/03/09/1-0-or-1-relationships-in-entity-framework/</guid>
		<description><![CDATA[I came across this problem today when migrating a project from VS 2008/.NET 3.5 to VS 2010 RC1/.NET 4.0. I don&#8217;t actually think it&#8217;s a VS 2010 thing, though. I have two entities A and B. There is a navigation &#8230; <a href="http://blog.arunstephens.com/2010/03/09/1-0-or-1-relationships-in-entity-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I came across this problem today when migrating a project from VS 2008/.NET 3.5 to VS 2010 RC1/.NET 4.0. I don&#8217;t actually think it&#8217;s a VS 2010 thing, though.</p>
<p>I have two entities A and B. There is a navigation property on A, and it can have either one or no instances of B. B&#8217;s foreign key is to A&#8217;s primary key (obviously) but B also has its own primary key. In the database, B has a unique index on that foreign key column, which will enforce the rule.</p>
<p>The problem when upgrading to VS 2010 occurred because I clicked the &#8220;Include foreign key columns in the model&#8221; check box when generating the model from the database. (I regenerated it because the tools might be better in 2010 so figured I should start from scratch.) That&#8217;s where my problem came from. The entity model designer wouldn&#8217;t let me change the navigation property and associated relationship from 1..* to 1..0 or 1, because the relationship had to be between the entities&#8217; keys for that to work.</p>
<p>The problem only happens when you generate the model with foreign keys as their own columns. I regenerated it so that foreign key columns weren&#8217;t generated (the foreign keys were represented only as their navigation properties) and it worked fine, as it did in VS 2008.</p>
<p>I found this answer here: <a href="http://stackoverflow.com/questions/2141328/unique-keys-not-recognized-by-entity-framework/2326859#2326859">http://stackoverflow.com/questions/2141328/unique-keys-not-recognized-by-entity-framework/2326859#2326859</a></p>
<p>Hopefully this might be of some help to someone else!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2010/03/09/1-0-or-1-relationships-in-entity-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX history with ASP.NET AJAX 1.0</title>
		<link>http://blog.arunstephens.com/2009/03/27/ajax-history-with-aspnet-ajax-10/</link>
		<comments>http://blog.arunstephens.com/2009/03/27/ajax-history-with-aspnet-ajax-10/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 15:36:12 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://arunstephens.com/?p=211</guid>
		<description><![CDATA[If you are still using the original ASP.NET AJAX 1.0 release, you may be looking for a way to use .NET 3.5 SP1&#8242;s &#8220;history&#8221; feature of the ScriptManager control. A while back, Nikhil Kothari wrote a component called UpdateHistory, which &#8230; <a href="http://blog.arunstephens.com/2009/03/27/ajax-history-with-aspnet-ajax-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are still using the original ASP.NET AJAX 1.0 release, you may be looking for a way to use <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.addhistorypoint.aspx">.NET 3.5 SP1&#8242;s &#8220;history&#8221; feature of the ScriptManager control</a>.</p>
<p>A while back, <a href="http://www.nikhilk.net/UpdateControls11.aspx">Nikhil Kothari wrote a component called UpdateHistory</a>, which looks like what was integrated into 3.5 SP1. It certainly solved my problem.</p>
<p>Combine it with <a href="http://msdn.microsoft.com/en-us/library/system.web.httputility.parsequerystring.aspx">HttpUtility.ParseQueryString</a> and you&#8217;re onto a winner!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2009/03/27/ajax-history-with-aspnet-ajax-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entity Framework: Part 2</title>
		<link>http://blog.arunstephens.com/2008/11/17/entity-framework-part-2/</link>
		<comments>http://blog.arunstephens.com/2008/11/17/entity-framework-part-2/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 01:23:15 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[entity-framework]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://arunstephens.com/2008/11/17/entity-framework-part-2</guid>
		<description><![CDATA[I have been reading a bit of the documentation about the ADO.NET Entity Framework. There are a few passages that relate to my previous post: Because referenced objects are not automatically loaded, you must call the Load method on the &#8230; <a href="http://blog.arunstephens.com/2008/11/17/entity-framework-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been reading a bit of the documentation about the ADO.NET Entity Framework. There are a few passages that relate to my <a href="http://arunstephens.com/2008/11/14/linq-to-entities-%e2%80%93-my-first-steps">previous post</a>:</p>
<blockquote><p>Because referenced objects are not automatically loaded, you must call the <a href="http://msdn.microsoft.com/en-us/library/bb896375.aspx">Load</a> method on the entity reference to load the related object data into the object context. You can also specify a query path that defines which related objects to load with returned objects. For more information, see <a href="http://msdn.microsoft.com/en-us/library/bb738642.aspx">Querying Data as Objects (Entity Framework)</a>.</p>
<p>&#8230;</p>
<p>A query path definition ensures that the <strong>Course</strong> objects related to <strong>Department</strong> objects are also returned.</p>
<ul>
<li><a title="http://msdn.microsoft.com/en-us/library/bb399760.aspx" href="http://msdn.microsoft.com/en-us/library/bb399760.aspx">http://msdn.microsoft.com/en-us/library/bb399760.aspx</a> </li>
</ul>
</blockquote>
<p>The code accompanying this is:</p>
<pre class="csharpcode"><span class="rem">// Define a query that returns all Department objects and related</span>
<span class="rem">// Course objects, ordered by name.</span>
ObjectQuery&lt;Department&gt; departmentQuery =
    schoolContext.Department.Include(<span class="str">&quot;Course&quot;</span>).OrderBy(<span class="str">&quot;it.Name&quot;</span>);</pre>
<p>Another difference between LINQ to SQL and using the Entity Framework is that the SubmitChanges() method&#8217;s equivalent is the SaveChanges() method.</p>
<p>So I managed to solve my original problem of not being able to follow references in related tables/objects by using the Include method when performing my queries:</p>
<p>My first test method from the last post, TestFooHasTwoBars() will pass when it&#8217;s written like this (new code is highlighted):</p>
<pre class="csharpcode">[TestMethod]
<span class="kwrd">public</span> <span class="kwrd">void</span> TestFooHasTwoBars()
{
    testlinqEntities entities = <span class="kwrd">new</span> testlinqEntities();
    Foo foo = (from f <span class="kwrd">in</span> entities.Foo<span class="highlight">.Include(<span class="str">&quot;Bar&quot;</span>)</span> <span class="kwrd">where</span> f.FooId == 1 

        select f).First();
    Assert.IsNotNull(foo);
    Assert.AreEqual(2, foo.Bar.Count);
}</pre>
<p>I&#8217;m not sure if there&#8217;s a way to do that in &quot;pure&quot; LINQ (ie without having to include the string to reference the Bar property.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2008/11/17/entity-framework-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQ to Entities – my first steps</title>
		<link>http://blog.arunstephens.com/2008/11/14/linq-to-entities-%e2%80%93-my-first-steps/</link>
		<comments>http://blog.arunstephens.com/2008/11/14/linq-to-entities-%e2%80%93-my-first-steps/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 01:40:18 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[linq-to-entities]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://arunstephens.com/?p=96</guid>
		<description><![CDATA[I have had little bit of experience with LINQ to SQL, but recently read that Microsoft is instead concentrating on LINQ to Entities. I have just started a new project, so thought decided to use LINQ to Entities instead. And &#8230; <a href="http://blog.arunstephens.com/2008/11/14/linq-to-entities-%e2%80%93-my-first-steps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have had little bit of experience with LINQ to SQL, but recently read that Microsoft is instead concentrating on LINQ to Entities. I have just started a new project, so thought decided to use LINQ to Entities instead. And I ran into a problem. I haven&#8217;t managed to find a solution to it yet, so I figured that I would write about it here and hopefully, once I have figured out what I was doing wrong, it might be able to help someone else out.</p>
<p>The problem is that I have a site using ASP.NET MVC (though that&#8217;s not really relevant) that uses the normal ASP.NET SQL membership provider. Then I have a table that has a foreign key reference to the aspnet_Users table:</p>
<p><img alt="" src="http://blog.arunstephens.com/wp-content/uploads/2008/11/111408-0139-linqtoentit11.png" /></p>
<p>So far, so good. I have created a user, and manually created a Foo and given it two Bars.</p>
<p>Now I create the ADO.NET Entity Data Model, generated from the database. I only want three tables in my model: aspnet_Users, Foo and Bar.</p>
<p><img alt="" src="http://blog.arunstephens.com/wp-content/uploads/2008/11/111408-0139-linqtoentit21.png" /></p>
<p>Not a lot is different there. In the end I want aspnet_Users to just be called User, but let&#8217;s just see if this is working out of the box. My prediction (based on how it actually worked in my real project, is that the reference between Bars and Foos is fine, but between Users and Foos will not work. Let&#8217;s see&#8230;</p>
<pre>[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestFooExists()
{
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Foo foo = (<span style="color: blue">from</span> f <span style="color: blue">in</span> entities.Foo <span style="color: blue">select</span> f).First();
    Assert.IsNotNull(foo);
}</pre>
<p>That test passed.</p>
<p>Next is to check that the Foo who&#8217;s ID is 1 has got two Bars.</p>
<pre>[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestFooHasTwoBars()
{
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Foo foo = (<span style="color: blue">from</span> f <span style="color: blue">in</span> entities.Foo <span style="color: blue">where</span> f.FooId == 1 <span style="color: blue">select</span> f).First();
    Assert.IsNotNull(foo);
    Assert.AreEqual(2, foo.Bar.Count);
}</pre>
<p>
  <br />This is a bit of a surprise. It failed. I can&#8217;t think why. Let&#8217;s check to see whether the first Bar has got a Foo:</p>
<p></p>
<pre>[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestBarHasAFoo()
{
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Bar bar = (<span style="color: blue">from</span> b <span style="color: blue">in</span> entities.Bar <span style="color: blue">select</span> b).First();
    Assert.IsNotNull(bar, <span style="color: #a31515">&quot;Could not find a Bar.&quot;</span>);
    Assert.IsNotNull(bar.Foo, <span style="color: #a31515">&quot;Bar has no Foo.&quot;</span>);
}</pre>
<p>No, that failed too. So none of the references are working. They worked out of the box with LINQ to SQL.</p>
<p>For good measure, I&#8217;ll write two more tests:</p>
<pre>

[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestFooHasUser()
{
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Foo foo = (<span style="color: blue">from</span> f <span style="color: blue">in</span> entities.Foo <span style="color: blue">where</span> f.FooId == 1 <span style="color: blue">select</span> f).First();
    Assert.IsNotNull(foo);
    Assert.IsNotNull(foo.aspnet_Users);
}

[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestUserHasAFoo()
{
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Guid userId = <span style="color: blue">new</span> Guid(<span style="color: #a31515">&quot;8c3efb04-80aa-4b6b-af11-98445a08f4ea&quot;</span>);
    aspnet_Users user = (<span style="color: blue">from</span> u <span style="color: blue">in</span> entities.aspnet_Users <span style="color: blue">where</span> 

        u.UserId == userId <span style="color: blue">select</span> u).First();
    Assert.IsNotNull(user);
    Assert.IsTrue(user.Foo.Count &gt; 0);
}

</pre>
<p>These failed too. As expected.</p>
<p>So, I am quite surprised that none of the relationships are actually working. Was it a fluke that they worked earlier?</p>
<p>No, I wrote another test, that gets a Bar&#8217;s Foo&#8217;s User&#8217;s ID:</p>
<pre>

[TestMethod]
<span style="color: blue">public</span> <span style="color: blue">void</span> TestGetUserIdOfFooOfBar()
{
    Guid expectedUserId = <span style="color: blue">new</span> Guid(<span style="color: #a31515">&quot;8c3efb04-80aa-4b6b-af11-98445a08f4ea&quot;</span>);
    testlinqEntities entities = <span style="color: blue">new</span> testlinqEntities();
    Guid userId = (<span style="color: blue">from</span> b <span style="color: blue">in</span> entities.Bar <span style="color: blue">where</span> b.BarId == 1 

        <span style="color: blue">select</span> b.Foo.aspnet_Users.UserId).First();
    Assert.AreEqual&lt;Guid&gt;(expectedUserId, userId);
}

</pre>
<p>And that one passes.</p>
<p>So, while in LINQ to SQL you could keep on following references after you had performed your original query, you can&#8217;t do that with LINQ to Entities. Well, not automatically, at least. That&#8217;s a bit of a disappointment. That means more work for me.</p>
<p>I just had a look at the Foo.Bar property. There is an IsLoaded property and a Load() method. If you Load() the Bar first, then the count works. LINQ to SQL didn&#8217;t need such as method, I guess, because it was always working against the database. I should probably read up more on this. It doesn&#8217;t seem right to call Load() which will probably load all of the properties of the &quot;child&quot; objects, when I only need one of those properties, or only need the first one.</p>
<p>I will investigate further and hopefully remember to post a followup.</p>
<p>But in summary, the IRelatedEnd.Load() method (the EntityCollection class derives from RelatedEnd which implements IRelatedEnd &#8211; sorry I can&#8217;t be bothered with the namespaces). It&#8217;s that method that will load the collection&#8217;s contents. That&#8217;s for one-to-many relationships. For the many-to-one and one-to-one side of things, I used, for example, Bar.FooReference.Load(). (FooReference is of type EntityReference&lt;Foo&gt;, which ultimately derives from RelatedEnd as well).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2008/11/14/linq-to-entities-%e2%80%93-my-first-steps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I like LINQ</title>
		<link>http://blog.arunstephens.com/2007/11/18/i-like-linq/</link>
		<comments>http://blog.arunstephens.com/2007/11/18/i-like-linq/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 08:01:24 +0000</pubDate>
		<dc:creator>arun</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[linq-to-sql]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://arunstephens.com/2007/11/18/i-like-linq/</guid>
		<description><![CDATA[LINQ stands for Language Integrated Query, a new feature of the .NET Framework 3.5. And it&#8217;s cool. I have used LINQ to SQL on the My Flatmates Facebook application, and it made things a lot quicker. LINQ to SQL creates &#8230; <a href="http://blog.arunstephens.com/2007/11/18/i-like-linq/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>LINQ stands for Language Integrated Query, a new feature of the .NET Framework 3.5. And it&#8217;s cool.</p>
<p>I have used LINQ to SQL on the <a href="http://apps.facebook.com/myflatmates/">My Flatmates</a> Facebook application, and it made things a lot quicker. LINQ to SQL creates classes out of your database tables. Then you can use LINQ statements to create instances of the classes from your data. I think that Ruby is similar in that you work directly against the database. But I&#8217;ve never worked with Ruby before and haven&#8217;t read anything about it (I think Siggy from <a href="http://www.silverstripe.com/">SilverStripe</a> told me about it, discussing the performance of PHP vs the ease of Ruby, but I digress).</p>
<p>It requires a change of thinking though. I&#8217;ve grown up believing that stored procedures are the way to go, for performance and security. But LINQ to SQL is more flexible when you don&#8217;t use stored procs. I did a bit of a search for what this means for best practice and it seems that best practice is changing. (And in the MySQL world, stored procs are only a new thing and most people don&#8217;t think they&#8217;re needed.)</p>
<p>That is why I like LINQ.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.arunstephens.com/2007/11/18/i-like-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

