Sunday, August 31, 2008

LINQ and Entity Framework Posts for 8/25/2008+

Note: This post is updated daily or more frequently, depending on the availability of new articles.

Update 8/30/2008 to 9/1/2008: Additions and updates
Update 8/29/2008: Additions
Update 8/28/2008: Additions
• Update 8/27/2008: Additions
Update 8/26/2008: SSDS is back on line as of 13:30 PDT

Entity Framework (EF)

•••• Julie Lerman’s EF Business Classes in ASP.NET Apps - Don't pass that query around! post of 8/31/2008 recommends that developers using EF

Return Results, not Queries from the Business classes

by forcing iteration by invoking the ToList(), FirstOrDefault() or similar method, or looping through a foreach structure.

•••• Shawn Wildermuth dispels The Fable of the Perfect ORM on 8/30/2008. He points out that at least the following factors enter into the selection of the object-relational mapping tool:

  • Functional Requirements
  • System Requirements
  • Skill-set of the Development Team
  • Business Factors
  • Time-to-Market
  • Business Culture
  • Lifetime of Project
  • Volatility of Schema

Shawn goes on to give examples of criteria for using LINQ to SQL, NHibernate, LLBLGen Pro, or Entity Framework.

•••• Julie Lerman’s More on Foreign Keys in EF post of 8/30/2008 describes a partial class to return the scalar value of a foreign key from an EntityReference. Foreign key values are useful for specifying associations with dropdown lists. (LINQ to SQL delivers foreign key values by default.)

•••• Matthieu Mezil demonstrates in his EF and WPF post of 8/29/2008 part of the code required for a WPF master-details application that enables using a combo box to choose the master for the details window.

••• Julie Lerman finds EntityKeys are case sensitive in her 8/29/2008 post. Improperly cased keys and property names return

  • The member with identity 'NWentities' does not exist in the metadata collection.
    Parameter name: 'identity'
  • The required entry 'customerID' was not found in the provided input. This entry is required by the key fields defined on type 'NWModel.Customer'

exceptions, respectively.

••• Matthieu Mezil strikes again on the table-per-hierarchy inheritance model in TPH Is Not NULL mapped on a relationship of 8/29/2008.

MaĆ­ra Wenzel's Handling Null Database Values Using Data Source Controls tip of 8/28/2008 notes that:

This topic Handling Null Database Values Using Data Source Controls has now been updated on MSDN to fix the sample based on various customer feedback. You can still see the old version here, in case you're curious to compare both versions.

Her post provides the details on what changed.

•• Matthieu Mezil continues his investigation of strangenesses in EF’s processing of a simple query in his LINQ To Entities: stranger and stranger post of 8/28/2008.

Jacob Proffitt’s Changing Table Names in an OR/M post of 8/27/2008 explains how to change EF and LINQ to SQL table names to suit a particular naming convention in both O/RMs’ XML mapping files. Jacob finds changing table names in EF is more difficult than LINQ to SQL.

•• Tim Mallalieu partially answered my Availability of Minutes of First "Advisory Committee" Meeting? question on 8/27/2008 in the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum:

We will put something out which will be a recap of the findings.

We we still need to do the final post mortem internally and then publish.

It’s the timetable that’s missing.

ADO.NET Data Services (Astoria)

•••• Shawn Wildermuth’s My ADO.NET Data Services/Silverlight 2 Article on MSDN Magazine post of 8/31/2008 points to his “Create Data-Centric Web Applications With Silverlight 2” article for the “Data Services” section of MSDN Magazine’s September 2008 issue. Shawn says:

What is cool about this approach is that you can issue LINQ queries on the client (in Silverlight 2) that will communicate with Data Services via the REST interface and execute queries and update data on the server.  The substantial difference that you will have to get used to is the use of Asynchronous LINQ queries in Silverlight 2.  Check out the article for all the details.

Marcelo Lopez Ruiz adds his two-cents to the Astoria history book with his ADO.NET Data Services History of 8/28/2009.

Vardi posted his Data Service Viewer 1.0 WinForm source code to CodePlex on 8/27/2008. Vardi says:

ADO.NET Data Services Tool help[s] you to create the query URL and view the result.

Marcelo Lopez Ruiz points out that “DateTimeOffset and Time properties are not available as CLR types in ADO.NET Data Services” in his Gotcha with EDM types in ADO.NET Data Services post of 8/27/2008.

Marcelo Lopez Ruiz continues with the reasons to use EF as Astoria’s back end in his timed Another ADO.NET Data Service metadata tip post of August 26. (Marcelo is on a one-week vacation.)

SQL Server Data Services (SSDS)

•••• Roger Jennings recommended that SSDS and Other Windows Cloud Services Should Have Their Own Blogs on 8/30/2008, seconding Ayende Rahien’s proposal of the day before.

Niraj Nagrani, Soumitra Sengupta, and David Robinson deliver A Candid Look at SQL Server Data Services and the Business Scenarios it Addresses in an 8/28/2008 interview by Greg Hughes. The trio tackles the following topics:

  • SSDS isn’t a hosted instance of SQL Server in the cloud, it’s an Internet-based data utility powered by SQL Server
  • Target market is businesses who offer Sofware as a Service (SaaS) applications, including small and medium-sized businesses, with multi-tenancy as an important feature
  • Integration of authentication with the BizTalk Services Identity Provider will be rolled out in the “very near future.”
  • Symmetry with on-premises instances will be outside-in rather than inside-out.
  • SSDS have the capability to hand on-premises data to SQL Server Integration Services (SSIS) and pump it up to the cloud or vice-versa.
  • Microsoft Sync Services will make SSDS into a “data hub.”
  • SQL Server Reporting Services and Analysis Services will be used to deliver reports on uptime, performance and the like.
  • SSDS will grow to 5,000 nodes next year.
  • Open beta will occur shortly after PDC 2008 and SSDS will go live in the first half of 2008.
  • SSDS will be the preferred store of compliance data for large businesses.

•••• Dave Robinson says in SSDS Tech-Ed Online Video Posted of 8/29/2008 that the interview was conducted at Tech•Ed North America 2008, which was held in early June, so the “very near future” appears not so near after all.

•• Soumitra Sengupta discusses Jon Udell’s “continuum of access styles” as it applies to SSDS in his Jon Udell cURL's with SQL Server Data Services post of 8/27/2008.

I’m not sure if just REST and SOAP as wire formats for queries constitute a “continuum,” but supporting AtomPub, JSON, and POX as wire formats as promised might qualify.

Jon Udell’s The continuum of access styles in the emerging Microsoft cloud post of 8/27/2008 mentions his ability to use cURL for basic SSDS navigation with the REST query protocol. Jon concludes:

Microsoft platforms have not historically encompassed the continuum of access styles. Happily, the emerging cloud does. And while the novelty of “just coding to a URL” on a Microsoft platform will undoubtedly attract some tirekickers who otherwise wouldn’t show up, the real draw will be the ability to exercise choice along the whole continuum.

That choice, by the way, is not only relevant to developers accessing hosted, web-facing services. It will matter as much — and with the SOAP option, even more — to developers accessing on-premises services behind the corporate firewall and across corporate boundaries. Facing outward or inward, you’re most productive when you can choose the right access style for the job at hand. Between the realm of the 100% Microsoft coder and the 0% Microsoft coder, a wide and fruitful middle ground is opening up.

Ryan Dunn complements Eugenio Pace’s Concurrency in SSDS post of 8/1/2008 for the SOAP protocol with Concurrency with SSDS via REST of 8/26/2008.

•• Mike Amundsen recounts his problems during the outage in the SSDS is unavailable for all beta users? (2008-08-26 06:00 PDT) [Resolved] thread in the SQL Server Data Services (SSDS) - Getting Started forum.

Roger Jennings’ SQL Server Data Services Beta Encounters First Major Unscheduled Downtime post describes the approximately 7.5 hour unscheduled outage that occurred on August 26, 2008. From the post:

The SSDS team is to be commended for keeping testers up to date on the progress of bringing the service back up. Their response contrasted with Amazon’s failure to alert customers of their February outage, as reported in Amazon Web Services Outage: Causes And Remedies of 2/16/2008.

•• The preceding post has been updated for subsequent events and blog posts and was moved to a separate post due to its increasing length.

Gianpaolo Carraro’s Multi Tenant Data Access (MTDA) Blueprint post of August 25, 2008 announces the availability of the MDTA Blueprint on CodePlex and a Channel 9 interview with Eugenio Pace, the developer. Here’s part of the description:

The Multi Tenant Data Access (MTDA) Blueprint, part of the Software-plus-Services Blueprint program, provides guidance on writing a SQL Server based, single instance, multi-tenant data access layer similar to that used in LitwareHR sample application (SQL Server version).

You need the S+S Blueprints Manager from CodePlex to install the MTDA blueprint. (I was unable to use it with my installation of VS 2008 SP1.)

Note: This blueprint doesn’t use SSDS, as far as I can determine so far.

ASP.NET Dynamic Data (DD)

•• Matt Berseth goes hog wild with home-page menu customization in his A Dynamic Menu For Your Dynamic Data post of 8/27/2008. Matt says:

I have my tables organized into 4 categories: Sales, People, Products and Reports.  And the cool thing is that this menu is completely dynamic.  You can add, remove or reorganize the categories without touching the UI.  And depending where you are keeping your metadata you could even do this without recompiling your app.  The grouping is automatically discovered from the metadata and the menu is built solely off the it so everything 'just works'.

Besides adding the grouping information, I also tagged each of my tables with a custom description that I am displaying under the grids title.  Nothing too complicated, but still interesting.


•••• Damien Guard’s T4 template update for LINQ to SQL in his original post of 8/29/2008 was premature. The latest version will add:

  • Inheritance support
  • VB.NET generation
  • DataContract serialization

But it won’t support stored procedures or composite primary keys.

An updated link in future issue of this post will be provided when the template is fully cooked.

Rob Conery’s Working With Linq's Expression Trees Visually post of 8/29/2008 shows you how to extract and install the Expression Tree Viewer add-in from the file and use it to view LINQ to SQL expression trees.

•• See Jacob Proffitt’s Changing Table Names in an OR/M post of 8/27/2008 in the “Entity Framework” section.

Simon Segal explains how POCO improves inheritance for LINQ to SQL in his lengthy post of 8/26/2008. He promises:

I will shortly be posting a framework that makes working in a POCO and DDD style much simpler. The Framework includes implemented Specification Patterns, Fetching Strategies and Extensible Repositories for your LINQ To SQL pleasure.

Jeff Atwood recommends adding the NOLOCK statement to SELECT queries to solve a mysterious deadlock problem with LINQ to SQL in his Deadlocked! post of 8/25/2008.

Jonas Stawski recommends being extra-careful when Recreating Entities with Linq To SQL in his 8/25/2008 post.

LinqMaster uncovers an arcane bug with insert triggers and provides a workaround in LINQ to SQL Database Trigger Bug – Workaround of 9/25/2008.

Rico Mariani answers questions by readers of his LINQ to SQL performance analysis series in Linq Compiled Queries Q&A of 9/25/2008.

LINQ to Objects, XML, et al.

••• Bart De Smet goes into excruciatingly detailed coverage of the use of SOS (a.k.a. “Son on Strike”) with dynamic expression trees in his lavishly illustrated To Bind or Not To Bind – Dynamic Expression Trees – Intermezzo: SOS in Visual Studio. Bart says:

In this post I want to point out that you can actually live without that visualizer and go the hard-core way using SOS, … the WinDbg extension for managed code debugging that ships with the .NET Framework (sos.dll). A little-known fact is that SOS can be loaded directly in Visual Studio through the Immediate Window.

•• Martin Hinshelwood says LINQ to XSD is “Absolutely brilliant” in his LINQ to XSD post of 8/28/2008. I’d say the LINQ to XML team would be “absolutely brilliant” if they posted a LINQ to XSD release version instead of Alpha 0.2.

• Bart De Smet’s second post of 8/27/2008, To Bind or Not To Bind – Dynamic Expression Trees – Part 2, delves into IL generation, expression compilation, and emitting code .

Bart De Smet continues his dissertation on dynamic expression trees with To Bind or Not To Bind – Dynamic Expression Trees – Part 1 of 8/27/2008 by creating a DynamicExpression abstract class with MethodCallDynamicExpression, LambdaDynamicExpression and ParameterDynamicExpression factory classes.

Jared Parsons uses a LINQ to XML-powered word-wheel application to demonstrate how to “Increase LINQ Query Performance” in his “Basic Instincts” column for MSDN Magazine’s August 2008 issue.

Ira’s LINQ Distinct, a DataTable and the IEqualityComparer<T> post of 8/26/2008 describes how to write a custom IEqualityComparer<DataRow> for LINQ to DataSet to enable the Distinct() operator to operate on entire rows instead of a single designated column.

Bart De Smet’s To Bind or Not To Bind – Dynamic Expression Trees – Part 0 post of 8/26/2008 is the start of a new series about building dynamic expression trees.

SQL Server Compact (SSCE) 3.5 and Sync Services

No SSCE/Sync Services posts to date.

Visual Studio 2008 Service Pack 1 (General)

• Mike Taulty’s Final .NET Client Profile ( 3 ) post of 8/26/2008 points to his WPF, ClickOnce and the .NET Client Profile Channel9 video of the same date with this description:

A simple demo of building a "Hello World" application with Visual Studio 2008 Service Pack 1 and then deploying it via ClickOnce to a clean Windows XP machine using the .NET Client Profile rather than the full .NET Framework.

Mike Taulty’s The .NET Client Profile post of 8/26/2008 and The .NET Client Profile ( 2 ) of 8/27/2008 cast a jaudiced eye on the process of installing .NET 3.5 SP 1 on client computers with ClickOnce. Mike says:

If you're building something like a .NET WPF client application then one of the major bugbears (for both you and for Microsoft - let's be honest here :-)) is trying to get the .NET Framework on to the client machine.

We're trying to make this easier but if you were to look at the recent .NET Framework packages you'd perhaps not be able to tell that :-)

Miscellaneous (WPF, WCF, Silverlight, etc.)

•••• Phil Haack announces ASP.NET MVC CodePlex Preview 5 Released on 8/29/2008 and says the next release will be the official beta version. The post contains links to other important MVC-related articles.

• Roger Jennings reports problems with Internet Explorer 8 Beta 2’s new Web Slices feature in Fail on First Try of Internet Explorer 8 Beta 2 Web Slices of 8/29/2008. •••• Updated

•• Roger Jennings takes Jaiku’s new Google App Engine implementation to task in Jaiku + Google App Engine = Fail of 8/28/2008. The malformed home page shown in the post, which has lost its CSS content, took over a minute to load.

•• Aaron Skonnard posted Endpoint Screencasts - Hosting WCF Services in IIS to Channel 9 on 8/28/2008:

In this short video, CSD MVP Aaron Skonnard from PluralSight guides the viewer through how to host your WCF Service in IIS. We will start with the simple WCF service that we created in the first screencast, hosting it as an ASP.NET svc file. Aaron then demonstrates adding a couple endpoints (for greater detail, see the screencast on creating WCF endpoints) and accessing the service. Once we have our WCF service hosted in ASP.NET, we add it as an application to IIS for consumption.

The IE Team posted IE 8 Beta 2 for download on 8/27/2008. I installed it to try Web Slices on LINQ and Entity Framework Posts for M/D/YYYY+. The first item in this category recounts my lack of success with implementing Web Slices.

John Papa’s Great Fiddler Tip For Localhost Testing post of 9/26/2008 describes Shawn Wildermuth’s solution to getting Fiddler 2 to recognize the Cassini Web server’s localhost:port number: Prefix the port number with a period.

WebSlice Content for Internet Explorer 8 Beta 2

OakLeaf LINQ and Entity Framework Links

Last Updated: 8/31/2008 2:20 PM PDT

  • Entity Framework Additions
  • SQL Server Data Services Additions/Updates
  • ASP.NET Dynamic Data Additions
  • LINQ to SQL Additions
  • LINQ to Objects, XML, etc. Additions
  • Miscellaneous Additions
    • ASP.NET MVC Preview 5 Released to CodePlex
    • Problems with IE8B2's Web Slices Feature

Saturday, August 30, 2008

SSDS and Other Windows Cloud Services Should Have Their Own Blogs

Ayende Rahien (a.k.a. Israeli .NET developer Oren Eini) contends in his Does you application has a blog? post of August 29, 2008 that applications should have blogs that report on “interesting events” that occur during their operation. Not blogs by developers or operations staffers about applications, but blogs authored by the application itself.

Ayende offers an Order Management example blog and says:

From the point of view of the system as a whole, now business users have a way to watch what the system is doing, check on status updates, etc. More than that, you can now use this as a way to post reports (weekly summary, for example) and in general vastly increase the visibility of the system. …

Now, this is explicitly not a place where you want to put technical details. This should be reserved to some other system, this is a high level overview on what the system is doing. Posts are built to be human readable and human sounding, to avoid boring the readers and to ensure that people actually use this.

Soumitra Sengupta mentioned during his Tech*Ed 2008 North America interview by Greg Hughes that the SQL Server Data Services (SSDS) team planned to use SQL Server Analysis Services and Reporting Services to keep users up to date on the services’ overall performance as well as usage and performance statistics for individual authorities.

Such reports seem to me to be ideally suited for transmission in the form of public and private blog posts with the appropriate Atom/RSS feeds. Adding a bit of Business Intelligence (BI) in the form of trend analysis and anomaly detection would also benefit users.

Similar autogenerated blogs would be equally useful for Biztalk Services Online, Exchange Online, SharePoint Online, and Dynamics CRM Online.

Friday, August 29, 2008

Fail on First Try of Internet Explorer 8 Beta 2 Web Slices

I do multiple updates of OakLeaf LINQ and Entity Framework Posts for M/D/YYYY, so I thought it would be useful to notify users of new and updated content for a particular post with Web Slices, a new feature of IE 8.

Updated 8/31/2008: Problem description clarified.

For Starters …

I read MSDN’s Subscribing to Content with Web Slices documentation, downloaded the Web Slice Templates for Internet Explorer 8 Beta 2, and added the following slightly modified CSS to my Blogger template: 

/* Web Slices Formatting CSS */
  display: table-cell; /* Organize as table */
  font-family: calibri; /* Readable font family */
  font-size: 11pt; /* Recommended font size */
  height: 228px; /* Height(240) - Margin(6) - Margin(6) */
  text-align: left; /* Left Alignment*/
  width: 348px; /* Width(360) - Margin(6) - Margin(6) */
  font-size: 14pt; /* Easily visible size */
  text-align: left; /* Left alignment*/
  font-weight: bold; 
  vertical-align: top; /* Keeps title near top of slice */

and used Windows Live Writer in Source view to add the following HTML to my page:

<div style="width: 360px" id="oakleaf" class="hslice">
  <div class="entry-content">
    <div style="border-spacing: 8px; display: table">
      <div style="display: table-row">
        <div class="panel">
          <div class="entry-title">OakLeaf LINQ and Entity Framework Links</div>
            <p><strong>Last Updated:</strong> 8/28/2008 4:45 PM PDT</p>
              <li>Entity Framework Additions </li>
              <li>SQL Server Data Services Additions/Updates </li>
              <li>ASP.NET Dynamic Data Additions </li>
              <li>LINQ to SQL Additions </li>
              <li>LINQ to Objects, XML, etc. Additions </li>
              <li>Miscellaneous Additions 
                  <li>Jaiku Failure with Google App Engine Deployment </li>
                  <li>Aaron Skonnard: Hosting WCF Web Services in IIS </li>

Here’s the resulting Web Slice in the page, which appeared as expected:

So I clicked Add to subscribe to the Web Slice, which added a Blogger OakLeaf … button to the Favorites toolbar.

The Problem …

Clicking the button opened an empty frame with brief appearance of a “Loading …” message and no content.

Clicking the Open the Web Page link button (right-arrow) returned an “Internet Explorer cannot display this feed” message with “A normalization error has occurred” subtitle. The URL that 404’s is Repeating the process with as the URL causes the same problem.

Comment: “A normalization error has occurred” without further explanation or pointer to a page with a solution for the problem is another example of an Error Message from Hell.

The FeedValidator site says the Atom.xml file is OK, as shown here:


Atom.xml opens as expected in IE 8 Beta 2 and Firefox 3, as well as Visual Studio 2008’s XML Editor. Firefox has no problem with opening pages to the two pages with the …/#oakleaf anchor and positioning at the Web Slice’s location.

So the question is: Where did I go wrong?

Update 8/31/2008: The problem appears to be related to IE 8 Beta 2’s reaction to the URL’s /# separator for positioning to a <div id=”oakleaf”> or <a name=”oakleaf”> anchor as in The separator should not include /, but IE 8 inserts the / if #name is typed directly after the base URL. This URL works from the address text box in IE 8 Beta 2 and Firefox 3, but not from the OakLeaf LINQ and Entit… Web Slice dropdown in the favorites toolbar.

It does not suffix a / to a named page, such as The latter URL works from the address box in IE 8 and Firefox 3, but not from the OakLeaf LINQ and Entit… Web Slice dropdown in the favorites toolbar.

Thursday, August 28, 2008

Jaiku + Google App Engine = Fail

Michelle Neylon announced Jaiku Back Online at 1:22 AM Thursday morning (8/28/2008) after being offline since last Saturday for a move from the Google acquisition’s single Finnish server to Google App Engine’s cloud infrastructure. Michelle concludes:

Twitter, even if it has a horrible UI, is still a lot more popular.

After waiting more than a minute for the home page to open, here’s the even worse UI that appeared for me:

Given the choice, I’ll stick with Twitter.

Full disclosure: After about 30 minutes I was able to load a more respectable version of Jaiku’s front page, but it still took more than 25 seconds.

SQL Server Data Services Beta Encounters First Major Unscheduled Downtime

• Update 8/28/2008: Added link to SSDS Blog Post of 8/27/2008 and comment to this post.

Update 8/27/2008: Moved from LINQ and Entity Framework Posts for 8/25/2008+ due to size and updated.

08/26/2008 07:04 PDT: The SQL Server Data Services (SSDS) team reported by e-mail what appeared to be unscheduled downtime. The message consisted of two instances of “Maintenance Notification” and nothing else.

08/26/2008 07:16 PDT: SSDS was reported to be recovering and functioning.

08/26/2008 07:54 PDT: SSDS was reported to be healthy. (The delay between the start of the downtime and the message timestamp isn’t known.)The message said “Details to follow.”

08/26/2008 08:14 PDT: The preceding message appears to be a false alarm because a subsequent message arrived at 08:14 PDT:

We are experiencing an unplanned downtime of the service. We are working with utmost urgency to correct the problem and to bring the service back up.

START: 08/26/2008, 06:00am
END: Unknown

Impact Alert:
SSDS is unavailable for all beta users

08/26/2008 08:45 PDT: Here’s the error message at 08:45 PDT from my SSDSNwindEntitiesCS project (see Updated SQL Server Data Services (SSDS) Test Harness: Northwind REST and SOAP Uploads of 7/27/2006):


The promised 09:00 and 10:00 messages reported SSDS was still down. At about 10:45 PDT, the error message changed to:

“We are experiencing internal network issues, thereby leading to an unplanned downtime of the service” was the 12:00 PDT message and the client returned the earlier error message.

08/26/2008 02:10 PDT: :

Status: Resolved 08/26/2008 01:30PM PDT

We have resolved the issue. The service has been restored and is fully functional.

We were able to isolate the problem, to an internal network issue that was preventing our servers from properly communicating. The issue has since been resolved and the service is back online.

The SSDSNwindEntitiesCS test harness is running as expected except for a hang that occurred when attempting to download the list of containers and entities on opening.

The problem reported was similar to that experienced by Amazon in their last major outage on July 20, 2008, as quoted here from CNet’s Amazon S3: For now at least, sometimes you have to reboot the cloud article of 7/21/2008:

"As a distributed system, the different components of S3 need to be aware of the state of each other. For example, this awareness makes it possible for the system to decide which redundant physical storage server to route a request to. We experienced a problem with those internal system communications, leaving the components unable to interact properly, and customers unable to successfully process requests. After exploring several alternatives, the team determined it had to take the service offline to restore proper communication and then bring service online again. These are sophisticated systems and it generally takes a while to get to root cause in such a situation," Amazon said. "We will be providing our customers with more information when we've fully investigated the incident."

The SSDS team is to be commended for keeping testers up to date on the progress of bringing the service back up. Their response contrasted with Amazon’s failure to alert customers of their February outage, as reported in Amazon Web Services Outage: Causes And Remedies of 2/16/2008.

• Update 8/28/2008: Soumitra Sengupta responds in a comment to this post.

The SSDS is unavailable for all beta users? (2008-08-26 06:00 PDT) [Resolved] thread in the SQL Server Data Services (SSDS) - Getting Started forum recounts Mike Amundsen’s problems during the outage.

• Update 8/28/2008: Soumitra Sengupta’s We experience our first major unscheduled downtime post of 8/27/2008 concludes:

The team is hard at work figuring out definitively what the root cause was and we will report back our findings and provide more details soon.  Trust can only be built through transparency and consistently delivering on your promise. 

Monday, August 25, 2008

LINQ and Entity Framework Posts for 8/20/2008+

Note: This post is updated daily or more frequently, depending on the availability of new articles.

Updated 8/25/2008

Updated 8/24/2008

• Updated 8/22/2008

Entity Framework (EF)

•• The Domain.Net Team’s NHibernate 2.0 gold Released – Must Wait for ‘Linq to NHibernate’ post of 8/24/2008 notes that NHibername 2.0 release yesterday without incorporating LINQ to NHibernate. You must download the implementation from a new location,

Fabio Maulo’s 21 chapters of NHibernate documentation as a Google Knol offers open contribution under a .

Muhammad Mosa discovers EF’s LINQ to Entities doesn’t support many constructs that LINQ to SQL handles with no problem. His LINQ to Entities, what is not supported? post of 8/24/2008 describes the following problems when migrating the data source of Rob Conery’s sample MVC Storefront project from LINQ to SQL to Entity Framework:

    • Custom Methods & Extension Methods cannot be translated into a store expression
    • LINQ to Entities only support Parameterless constructors and Initializers
    • IEnumrable types cannot be initialized in LINQ to Entities query

You can download Moses’s project from a link on his post.

•• Matthieu Mezil finds that the orderby … descending expression produces unexpected results in his LINQ To Entities: Strange, very strange post of 8/23/2008.

Matthieu Mezil’s TPH limitation which should disappear with v2 post of 8/23/2008 describes an exception when using Is Null and IsNot Null conditions on a table-per-hierarchy inheritence model (see below) that shouldn’t happen and needs fixing in EF v2.

Matthieu Mezil discusses the use of NULL values in the type discriminator column of a table-per-hierarchy inheritance model in his TPH is more than a selection! post of 8/22/2008.

Mikael Henriksson waxes enthusiastic about EF in Entity Framework - The best thing since the wheel? of 8/22/2008. He’s using EF in a real-world project and says:

Entity Framework can't replace working within a well thought through Domain Model but it sure helps me in my everyday work. I just finished a drafting a part of our application that took month and a half to get up and running the first time (I was not involved in the first version). It took me 2 days to come up with a pretty much solid version 2 of that same part.

Mikael claims using EF reduced the 60 developer*day project to 4 developer*days (including 2 days for adding business validation rules)

Ido Flatow shows you how to change CSDL and MSL files programmatically in his Change Entity Framework storage DB schema in runtime of 2/22/2008. Changing files at runtime enables working with experimental, developmental, and production databases without the need to change and recompile your EF code.

Matthieu Mezil explains in How to have a property on ObjectContext which returns the derived entities? of 8/21/2008 how to customize the code generator to add a property for the EntitySet of an inherited property in two passes. However, this later version does the same job in a single pass.

David Yack finds that adding a type declaration for the from clause’s parameter in a LINQ to Entities expression adds a Cast<T> operator to the translated expression in his Entity Framework - Cast Affects Include post of 8/21/2008. The spurious Cast<T> operator caused his Include() method to fail. Removing the type declaration solves the problem.

ADO.NET Data Services (Astoria)

•• Dare Obasanjo’s RESTful JSON: Bringing REST and RPC Closer Together post of 8/24/2008 analyzes comments by Dave Winer and Tim Bray about Dare’s earlier Explaining REST To Damien Katz essay. Dare concludes:

If you put together the notion of service documents with using JSON as the payload format for a service endpoint, you're close to getting the touted programmer friendliness of RPC technologies like XML-RPC & SOAP/WSDL while still building a RESTful service which works with the Web instead of against it.

The only problem is how to deal with statically typed languages like C# and Java. These languages need the types of the objects that application will consume from a Web service defined up front. So if we could just figure out how to come up with service documents for JSON services that included the notion of a class definition, we could pretty much have our cake and eat it to with regards to getting the ease of use of an RPC system while building a RESTful service.

Sounds to me like an interesting development that might apply to Astoria v2 and SSDS.

Marcelo Lopez Ruiz adds another reason why you’ll probably want to use ES as Astoria’s O/RM data source, despite the performance hit when you first spin it up with a large number of objects. His EntityState problems in ADO.NET Data Service post of 8/22/2008 reports:

[I]f you are using a 'T' that's not the ObjectContext-derived type in your DataService<T>, the service won't know you're using an ADO.NET Entity Framework types, and will try to discover types and properties by following references, which eventually leads to the EntityState property problem. Using the ObjectContext type as the 'T' should then solve the problem.

Marcelo Lopez Ruiz demonstrates why the Entity Data Model is Astoria’s default data source in Metadata for ADO.NET Data Services of 8/21/2008: The $metadata resource returns a description of the data model in EDM’s Conceptual Schema Definition Language (CSDL).

Pablo Castro offers a summary history of ADO.NET Data Services in his Timeline of Project Astoria of 8/20/2008 categorized as: Idea, Hack, Pitch, Prototype, Review, Announcement, Team, Design, Release, Future. Makes interesting reading.

Alex Barnett recalls three of his Astoria experiences in How ADO.NET Data Services came to be (formerly known as Project Astoria) of 8/20/2008.

Marcelo Lopez Ruiz explains the DataServiceContext.UsePostTunneling property in POST tunneling in ADO.NET Data Services of 8/20/2008.

Scott Hanselman’s The Weekly Source Code 32- Atom, AtomPub and BlogSvc, an AtomPub Server in WCF post of 8/20/2008 provides more insight into in System.ServiceModel.Syndication and ServiceDocument in the context of the new open-source BlogSvc implementation of AtomPub that’s compatible with Windows Live Writer.

Gil Fink comments on Arnon Rotem-Gal-Oz’s Why the Database as a
Service is a Bad Idea
post in Why Data as a Service isn't a Bad Idea of 8/20/2008 and concludes:

So what is the potential of ADO.NET Data Services?
In a RIA … or data driven application it can help to provide a cleaner solution. The ability of Data Services to return responses in JSON or in URI makes them flexible and usable by Ajax or Silverlight. Also, if the data service is consumed by a .Net client you can use the LINQ to [REST] feature. The Data Services come with other features like concurrency, batch operations over HTTP, full query operation support and more. These features, when used right, can help to provide good solutions for a data driven application.

SQL Server Data Services (SSDS)

Mike Amundsen is Looking for Suggestions on Implementing One-to-Many, Many-to-Many Patterns in SSDS, according to his 8/22/2008 thread in the SQL Server Data Services (SSDS) - Getting Started forum. Hopefully, an SSDS team member will provide insight how the service will emulate joins on the client efficiently. (As I read the tea leaves, there are no plans for the service to implement joins.)

Stephen Wynkoop Challenges with Data Management in the Cloud? article from the SQL Server Worldwide Users Group ( newsletter of 8/21/2008 suggests that data stored in cloud databases …

can be accessed by serving appropriate warrants or other legal processes to the cloud provider.  In some cases, this can be done without notifying the owner of the information (such as cases where they think that by knowing, the owner could/would/might destroy information). …

Perhaps we need a system where the information stored in the cloud is done so encrypted, with keys that are owned by the information owner only.  That way the cloud provider returns to being just that, a service provider, without having responsibility (or access) for/to the data on their systems.

I believe that this is a topic that the SSDS Team should consider for implementation in v1 RTM but probably requires SQL Server 2008. (The present “CloudDB” runs on modified SQL Server 2005.)

ASP.NET Dynamic Data (DD)

Matt Berseth drills down on the use of DD’s MetadataType attribute in his Dynamic Data and Custom Metadata Providers post of 8/24/2008.

• Scott Hunter’s Image Generation is released to CodePlex post of 8/21/2008 describes the long-awaited ASP.NET GeneratedImage replacement for Whidbey’s (!) DynamicImage feature that got cut from VS 2005. GeneratedImage is an ASP.NET control that automatically generates an ImageHandler and wires the control to its URL. The new control is ideal for use in DD projects.

ImageHandler is an implementation of IHttpHandler that, according to Scott, supports:

  • Transforms (resizing, watermarks, user defined transforms)
  • Client-side caching
  • Server side caching
  • Access to parameters passed from the GeneratedImage control
  • Provide simple mechanics for returning images

• Scott Hanselman’s ASP.NET Futures - Generating Dynamic Images with HttpHandlers gets Easier post of 8/21/2008 provides examples of creating and using the GeneratedImage control.

• Matt Berseth offered yet another ASP.NET Dynamic Data - Simple 5 Table Northwind Example on 8/21/2008. He says:

I am pretty impressed and I am looking forward to exploring this further - stay tuned.

Matt Berseth being “pretty impressed” with DD bodes well for its future.

Josh Heyse uploaded Dynamic Data Filtering v1.01, which eliminates private reflection, to CodePlex on 8/20/2008. Josh says he “worked with the Dynamic Data team to open up several internal method calls to eliminate the need for the reflection.”

You can learn more about Dynamic Data Filtering, which adds:

  • Searching ranges (ListPrice > 10 AND ListPrice < 500)
  • Searching in a list of possible values (Class in (‘L’, ‘M’))
  • Partial text searching (Color LIKE ‘B%’)

to the stock DD filters, from the five-part A Richer DynamicFilterRepeater series on Josh’s blog.

Justin Etheredge’s Exploring System.Web.Routing post of 8/20/2008 is a detailed tutorial on the new URL mapping feature introduced by VS 2008 SP1 for ASP.NET MVC and DD.


••• David DeWinter requests potential users to suggest features for his LINQ to SQL utility that supports updating the object model from the database schema and property-name fixup in his DBML Fixup Preview post of 8/24/2008. David’s current feature list appears to duplicate the LINQ to SQL capabilties of Kris Andersson’s Huagati DBML/EDMX Tools. David has scheduled DBML Fixup for a year-end release.

•• Andrew Davey suggests a set of rules for creating “convention-based mapping” with LINQ to SQL’s XML mapping files to minimize manual authoring in his LINQ-to-SQL Convention Mapping Source post of 8/24/2008

• Beth Massi’s Data on the Smart Client Talk at Bay.NET UG post of 8/21/2008 provides a link to her databinding to WinForms and WPF clients presentation to the Bay.NET user group and its sample code. (The OMS.mdf database file required for the demos is in the …\LINQSQLDemo\OMSDataLayer folder.)

Jim Wooley delves into Object Identity tracking changes with LINQ to SQL SP1 on 8/21/2008 and explains that LINQ to SQL checks the cache before sending a T-SQL query to retrieve a single entity instance.

Simon Segal offers props to LINQ to SQL in The future of LINQ To SQL and showing some support of July 30, 2008 and the bumper sticker below to proclaim solidarity with the first and fastest LINQ O/RM implementation:

which links to Ian Cooper’s Showing some support for LINQ to SQL post of July 2, 2008. Ian says, in part:

I would like to see MS give this product the support it deserves. I would like to see a commitment from the Data Platform team to stop its focus on talking LINQ to SQL down as a RAD tool and tallking up its advantages for use in the OO approaches to software development. For example  I would like to see the Data Platform team talking about LINQ to SQL's support for POCO strategies, lazy loading, etc. and pointing out to customers who request those features. There needs to be more acknowledgement that if you want them you should consider LINQ to SQL.

[I missed these items when originally posted.]

LINQ to Objects, XML, et al.

••• Jim Wooley shows you how to Enable the Expression Tree Visualizer in VS 2008 in his 8/24/2008 post.

•• Damon Wilder Carr’s LINQ to Financial Markets : Optimizing Provider to Real-Time Quotes, Analytics, and Silverlight-WPF Visualization post of 8/22/2008 describes a forthcoming LINQ implementation that offers:

An easier way to consume, visualize, understand and quantify just about any information you can imagine from the world of global financial services.

  • Real-Time stock quotes to Complex Analytics of Multi-Asset Class Portfolios
  • Monte-Carlo simulation with Optional Quantitative Add-Ins
  • Efficient frontier Optimization based on Constraints you Set
  • User defined heuristics from strategic rebalancing to day-trading

Release of the new provider currently is in limbo. Damon says:

Due to the nature of the access to this information, we are still working out the details for the open-source version we plan to offer soon. The world of the owners of this data has not caught up to the philosophy we have for transparency and shared value.

•• Jim Wooley says “LINQ to Reflection isn't really a provider, but just a specific implementation of LINQ to Objects which happens to query reflection information” in his LINQ to Reflection IsNot LinqProvider post of 8/23/2008.

• Eric White’s Using LINQ to XML to Retrieve Content Controls in Word 2007 post of 8/21/2008 shows you how to write a LINQ query to retrieve the contents of Word 2007’s content controls.

Bart De Smet gets the Longest Post Title Award for What Do VB 9.0 Error “BC36593: Expression of type ‘X’ is not queryable.” And C# 3.0 Error “CS1936: Could not find an implementation of the query pattern for source type ‘X’.” Really Mean? of 8/20/2008. His essay explains in granular detail what these VB (!) and C# error messages mean.

Mike Ormond discovers in his LINQ to JSON post of 8/21/2008 that LINQ to JSON from Silverlight’s System.Json namespace saves a lot of code because he doesn’t need to define a .NET type to represent the JSON object.

SQL Server Compact (SSCE) 3.5 and Sync Services

No SSCE posts as of 11:00 PDT. 

Visual Studio 2008 Service Pack 1 (General)

Scott Hanselman’s SmallestDotNet: On the Size of the .NET Framework post of 8/23/2008 describes options for upgrading client PCs to .NET Framework 3.5 with installers that range in size from 10 MB to 56 MB, depending on the client’s current versions. Scott also describes the Client Profile:

The Client Profile is an even smaller install option for .NET 3.5 SP1 on XP. It's small 277k bootstrapper. When it's run on a Windows XP SP2 machines with no .NET Framework installed, it will download a 28 meg payload and give you a client-specific subset of .NET 3.5.  If the Client Profile bootstrapper is run on a machine with any version of .NET on it, it'll act the same as the 3.5 SP1 web installer and detect what it needs to download, then go get it.  There's more details in the Client Profile Deployment Guide.

Scott also announces his new SmallestDotNet page that executes a small chunk of JavaScript to inspect your browser’s UserAgent and determine what version of the .NET Fx is installed. The script reports the total size of the download to update to .NET Fx 3.5.

Microsoft Downloads offers the Visual Studio 2008 SDK 1.1 as of 8/20/2008:

The Visual Studio 2008 Software Development Kit (SDK) 1.1 includes tools, documentation, and samples for developers to design, build, test and deploy extensions for Visual Studio 2008 Service Pack 1. You can also use the Visual Studio 2008 SDK 1.1 to create custom tools environments based on the Visual Studio 2008 Service Pack 1 Shell.

Miscellaneous (WPF, WCF, Silverlight, etc.)

The SQL Server Worldwide User Group ( will present a .NET Virtual Conference on October 28-30, 2008. Presenters include .NET and EF luminaries such as Kathleen Dollard, Ben Hoelting, Tim Huckaby, Tim Huer, and David Yack.

Dare Obasanjo’s Some Thoughts on Amazon's Elastic Block Store essay of 8/21/2008 about Amazon’s new EBS service, which provides 1 GB to 1 TB blocks of persistent storage that you can format as a file system, concludes:

EBS is the final piece in the puzzle that had prevented Amazon's cloud computing platform from being comparable to traditional hosting solutions. With EBS Amazon is now superior to most traditional hosting solutions from a developer usability perspective as well as cost. Google App Engine now looks like a plaything in comparison. In fact, you could build GAE on top of Amazon's cloud computing platform now that the EBS has solved persistent custom storage problem.

Werner Vogels, Amazon’s CTO, announced that Amazon EBS - Elastic Block Store has launched on 8/20/2008. His post contains additional details about EBS. Vogels announced plans to create EBS in his Persistent Storage for Amazon EC2 post of 4/13/2008.

Wednesday, August 20, 2008

LINQ and Entity Framework Posts for 8/18/2008+

Note: This post is updated daily or more frequently, depending on the availability of new articles.

• Updated 8/20/2008

Entity Framework (EF)

• Matthieu Mezil explains how to trick EF into accommodating a stored procedure for returning data from a SELECT statement that you don’t want to surface as an EntitySet on the ObjectContext in his EF: SELECT with a SP post of 8/20/2008.

• Julie Lerman’s Reposting Entity Framework Tutorials over on post of 8/20/2008 announces that she’s uploaded six of her EF tutorials, formerly available on the now-dark site, to

The .NET Rocks Duo interviews Dan Simmons and Stephen Forte on the EF Advisory Council for show #369 of 8/19/2008. Here’s the description:

Dan Simmons is back with Stephen Forte, a member of the EF Advisory Council, a group of outsiders who were brought in to help shape future direction for the EF. You might be surprised at who else was on the council, and what they are thinking about for the next version.

The action starts at 08:35, but Danny and Stephen don’t start talking about the first two-day EF Advisory Council meeting until 11:40. Danny gets into integrating the EDM with ADO.NET Sync Services starting at about 49:15 and a discussion of what’s coming in EF v2 at 52:20.

• Frans Bouma, lead developer of the LLBLGen Pro O/RM tool, takes on one of Stephen Forte’s comments about the Entity Data Model (EDM) in yesterday’s .NET Rocks interview (see above.) Frans’ lengthy "The Entity Data Model is much bigger than just an ORM" -- Stephen Forte post of 8/20/2008 argues that EF is yet another O/RM tool; nothing else.

I believe that Stephen was referring to the EDM and its implementations for other scenarios, such as Reporting Services and Sync Services, not to Entity Framework, which is the O/RM implementation of the EDM. Microsoft’s Zlatko Michailov (in Entity Framework and Object/Relational Mapping of 12/14/2007) and others, notably Shawn Wildermuth (in “Introducing the Entity Framework” of May 2007), have muddied the water by stating explicitly that the “Entity Framework is not an object/relational mapping tool” or words to that effect.

Roger Jennings discusses issues with long instantiation times when starting a Windows form project with an Entity Data Model from a 120-table database in his Entity Framework Instantiation Times with a 120-Table Database post of 8/19/2008.

• Julie Lerman’s Comparing times for loading models of different (exaggerated) sizes post of 8/20/2008 compares the times to cache the metadata of the AdventureWorksLT database (17 tables) and the 400-table database of her earlier Entity Framework Designer and Large Databases article. Julie’s 400-table example loads in about 4.4 seconds compared to about 9.5 seconds for my 120-table database. Her faster cache time might be due to a faster computer. I’m running Vista Ultimate on a Gateway desktop having a dual-core 2.8-GHz Pentium with 4 GB RAM (100+ MB free) and a 7,200-RPM SATA drive. Another possibility is a difference in the total number of columns and associations. My 120-table Huagati database has about 1,529 columns and 410 associations.

Matthieu Mezil’s SSDL View and CUD operations post of 8/19/2008 explains what happens when you “want to CUD an entity which maps on a table and (with Entity Splitting) a SSDL view?” He also includes the <Function> CUD elements you must add to the SSDL group and their mapping in the MSL group.

ADO.NET Data Services (Astoria)

• Aaron Skonnard’s new Wednesday Endpoint Screencasts series on Windows Communication Foundation (and Workflow) have started on Channel9. Here are links to the first two:

  • Configuring Services with Endpoints. This screencast introduces you to WCF adapters, bindings, and contracts, and shows you how to use the WCF Service Configuration Editor to modify these endpoints and add new endpoints. (8/20/2008)
  • Creating Your First WCF Service The screencast walks you through creating the service from scratch in VS2008 - defining a data contract, a service contract, and testing/hosting the service in VS2008. (8/13/2008)

Marcelo Lopez Ruiz explains why System.Data.Services.Internal is rather visible in his 8/20/2008 post.

Marcelo Lopez Ruiz describes the three methods of the DataService<T> class that you might want to override (CreateDataSource, OnStartProcessingRequest and HandleException) in his Overriding methods on System.Data.Services.DataService<T> post of 8/18/2008.

Raju Phani shows you how to implement a Count method on the server and client side of a ADO.NET Data Service in Entities , How many ways do I count thee? of 8/18/2008.

SQL Server Data Services (SSDS)

Soumitra Sengupta announces SSDS Software Developer Kit (SDK) Beta Released on MSDN on 8/19/2008. The SDK includes the command line tool and the SSDS Explorer that Soumitra demonstrated at TechEd 2008. You can download the SSDS SDK Beta

Mike Amundsen announced in an SQL Server Data Services (SSDS) - Getting Started thread, SSDSDeploy.exe demo app posted, “a new demo app that allows users to upload one or more files (using wildcards) to the SSDS servers.” Mike says,

One of the interesting items in this demo is a method GetMimeType(string filename) that uses the Registry to resolve the selected file's MIME type before sending it on to SSDS. The code is not very complex, but might have some security implications. I'd be curious to hear if anyone has trouble running the code in partial trust.

David Chappell’s “A Short Introduction to Cloud Services” white paper dated August 2008 provides “an enterprise-oriented view” of cloud computing as a whole, with the emphasis on cloud platforms:

As its name suggests, this kind of platform lets developers write applications that run in the cloud, or use services provided from the cloud, or both. Different names are used for this kind of platform today, including on-demand platform and platform as a service (PaaS). Whatever it’s called, this new way of supporting applications has great potential.

Microsoft sponsored the whitepaper but the document covers Amazon, Google and Microsoft platforms and/or services. There’s no mention of SSDS but it clearly conforms to Chappell’s definition of a cloud platform.

Thanks to Mary Jo Foley for the pointer to the whitepaper in her Piecing together Microsoft’s cloud-computing vision of 8/19/2008.

ASP.NET Dynamic Data (DD)

No new DD posts as of 8/19/2008 17:30


• Jim Wooley’s Where clause optimized with VB 2008 SP1 post of 8/20/2008 explains VS 2001 SP1’s simplification of LINQ to SQL WHERE clauses by replacing the WHERE (COALESCE(CASE … WHEN)) with a simple comparison expression for Nullable(Of T) types and the VB bug fix by the VB Ordering of Anonymous Type Properties change with VS 2008 SP1 post of the same day.

Dan Whalin provides a detailed tutorial on substituting XML mapping for .dbml files in his Using LINQ to SQL XML Mapping Files – Step by Step post of 8/19/2008.

LINQ to Objects, XML, et al.

• Alex Thissen points out that “[t]he new XML API that comes with LINQ to XML has some peculiar ways of handling the XML declaration (aka the XML prolog)” in his XML declarations in LINQ to XML post of August 19, 2008, and then points out workarounds for the peculiarities.

• LinqMaster’s Tutorial Reading A Text File Using LINQ to Objects post of 8/20/2008 shows you how to parse a comma-separated (or tab-separated) values file directly into a LINQ query.

Bart De Smet’s Probably The Most Powerful LINQ Operator: SelectMany post of 8/19/2008 tells you more than you might have wanted to know about the SelectMany() standard query operator. He analogizes SelectMany() with nested foreach statements that iterate over Cartesian products created by multiple from statements in LINQ queries.

Eric White is Microsoft’s Technical Evangelist for Open XML and usually writes posts about LINQ to XML. For a change, two of these three Find Duplicates using LINQ, Use a Lambda Expression for an Event Handler, Chunking a Collection into Groups of Three posts of 8/19/2008 are about LINQ to Objects.

SQL Server Compact 3.5 and Sync Services

No new SSCE or Sync Services posts as of 8/19/2008 17:30

Visual Studio 2008 Service Pack 1 (General)

Johathan Carter, Microsoft’s technical evangelist for the .NET Framework and Visual Studio, provides a detailed list of what’s in the recently release .NET 3.5 Enhancements Training Kit RTM.

Miscellaneous (WPF, WCF, Silverlight, etc.)

Tuesday, August 19, 2008

Entity Framework Instantiation Times with a 120-Table Database

Updated 9/30/2008: Added association and properties (fields) count, and LINQ to SQL model generation times.

Julie Lerman discusses in Entity Framework Designer and Large Databases of 8/19/2008 how the number of tables in a database affects the time to generate Entity Framework (EF) v1 RTM’s Entity Data Model (EDM). She says:

According to Noam Ben-Ami who is on the team that works on the designer, the performance for the designer itself should have “typically reasonable” performance for up to “about 120 tables, after which things begin slowing down.”

Her test with a 400-table database took the EDM Wizard about 20 seconds to generate the visual model. “Saving the model took about 1/2 minute as it generated the classes.”

I noted in my LINQ and Entity Framework Posts for 8/12/2008 post, Kristofer Andersson of Huageti Systems gave up after the EDM Wizard spent three hours attempting to create and EDM of a 1,000-table SQL Server database.

A 120-table database (from Huageti Systems), which is typical of those used by a reservation system for small airlines but contains no data, took 50 seconds to generate the model in the EDM Designer. The same operation with LINQ to SQL takes 22 seconds.

Update 9/30/2008: The entities have a total of 205 associations and 1190 scalar properties (9.9 properties/entity.)

What’s more important, in my opinion, is the time to generate the EDM at runtime. The following table lists the times to instantiate and cache the runtime EDM with LINQ to SQL and Entity Framework in a WinForm client.

Times to Instantiate a 120-Table Entity Data Model in a Windows Form Client



Entity Framework

Data/ObjectContext initiation time (first), s.



ObjectContext initiation time (precompiled), s.



Data/ObjectContext recreation time (next), s.



Clearly, 9.5 seconds to cache the EDM is excessive and waiting 2 seconds for a precompiled version to open isn’t satisfactory. (The preceding times were generated with EF v1 Beta; there’s no significant difference with EF v1 RTM. See my Comparison of Entity Framework and LINQ to SQL Projects Using a 120-Table Database post of July 12, 2008.)

Update 8/19/2008: ObjectContext initiation consumes about 60% to 80% of CPU time for the full 9+ seconds. The metadata cache size (without data) is 21 MB.

I wonder how long it would take a 400-table EDM to open. Perhaps 30 seconds, if that’s what Julie meant by “saving the model.”