Friday, August 07, 2009

LINQ and Entity Framework Posts for 7/27/2009+

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

Updated 8/7/2009: SQLite C# port reinstated
• Updated 8/2/2009: C# port of SQLite bruhaha and other additions/updates.

Entity Framework and Entity Data Model (EF/EDM)

Gunnar Peipman says in his LINQ To Entities, SQL and performance of 8/2/2009:

I have introduced my photo gallery building process in couple of postings. As my gallery uses Entity Framework 4.0 it is good source for some internal processing that takes place inside Entity Framework. In this posting I will show you some LINQ To Entities queries and SQL that is generated for them. I added also some thoughts about performance. …

Julie Lerman reports A big step for Stored Procedures in EF4 in her 8/1/2009 post:

When you are building or updating a model from a database, included Stored Procedures find their way into the SSDL (Store Schema Description Layer) of the metadata but not into the conceptual model. In order to expose them in your model, you need to create something called a Function Import which imports that stored proc from your SSDL into your model.

In EF4, when you run the Function Import Wizard, you will see a new option: Complex.


Complex Types have been around since the beginning of Entity Framework however there was no designer support for them. Check this blog post (Complex Types in the EDM Designer in EF4 and a look at updating complex types in code) to see how the designer now supports Complex Types in VS2010.

Alex JamesTip 29 – How to avoid LazyLoad or Load() reader issues of 7/31/2009 warns Entity Framework users to turn on Multiple Active Result Sets (MARS) in  connection strings you write yourself if you load associated entities. …

Tim Mallalieu’s EF Data Access: EF v2 and Data Access Architecture Best Practices article for MSDN Magazine’s August issue carries this deck:

Developers deploy a wide variety of development philosophies and architecture styles. This article explores three common perspectives on application development and describes how the Entity Framework can be employed in each. Specifically, the article looks at the forms-centric, model-centric, and code-centric development styles and their relationship to the Entity Framework. …

Alex James offers Some comments on efficient SOA method composition on 7/30/2009:

A couple of posts back I started talking about composing SOAPY operations efficiently, by shipping intent to the service.

An interesting debate ensued in my comments:

Kristofer (the guy behind the Huagati tools for DBML and EDMX, and it seems a man after my own heart) got all excited and suggested the name LINQ to WCF. …

Syed Mehroz Alam RIA Services: Working with Foreign Keys/Associations in Entity Framework post of 7/29/2009 begins:

Yesterday, I got an strange observation regarding RIA Services. I needed to created an Entity Model from views instead of tables so it had no foreign key associations defined. I manually created the associations and was finally able to get a working model. I then added a RIA Domain Service and got the following error upon build:

“Unable to retrieve AssociationType for association ‘JobWBS_ResourceAssignment’”

and explains the workaround for an RIA idiosyncrasy.

Simon Segal Entity Framework 4.0 and Fetching Strategies post of 7/29/2009 says:

… Fetching Strategies are a key concept when considering tuning your data access code in Event Driven Architectures. By using ‘roles’ to explicitly fetch data either eagerly, lazily or some combination thereof, we can build fetching strategies to load accordingly when a role has been specified. The role can be reasoned as a business event of sorts. Udi has written extensively on this and developed a method for using fetching strategies with NHibernate and if you haven’t yet checked out what he’s had to say to date on the subject I suggest you take a look. …

Rudy Lacovara explains on 7/28/2009 his use of a Fluent Interface for Composing Entity Framework Queries:

I’ve been doing a fair amount of work with Entity Framework recently.  There are some things about EF that make me want to throw it out the window, but this post is about something that I really like, the ability to eliminate redundant code from my BLL and DLL and create a fluent interface for composing queries. …

Bob Beauchemin’s Latest column on data access and perf available post of 7/28/2009 points out:

My latest MSDN column is available in the August issue and called "How Data Access Affects Database Performance". It was inspired by a problem that one of my DBA friends noticed in the database that could only be fixed by changing the data access code.

I noticed that there were two articles in the issue on EDM and, although I'm using native ADO.NET code for examples, I mention how EDM-generated code fits into one of the common cases. …

Danny Simmons claims his Entity Framework: N-Tier Application Patterns article for for MSDN Magazine’s August issue:

This article examines n-tier patterns for success and some of the key APIs and issues specific to the Entity Framework. It also provides a sneak peak at features coming in the Microsoft .NET Framework 4 that should make n-tier development significantly easier. …

Alex James suggests And while you are at it… why can’t I compose REST calls? on 7/28/2009:

In my last post I asked why you can’t compose SOA method calls efficiently.

With REST services like ADO.NET Data Services having nice uniform URLs too, and a model (aka EDM) why can’t I compose those with my SOA methods too. …

Diego Vega explains WPF databinding with the [EF v2] POCO Template in this 7/26/2009 post:

The new support for POCO in Entity Framework seeks to enable better ways of coding application domain logic without polluting domain classes with persistence concerns. Persistence Ignorance can in fact improve maintainability, testability and evolvability of an application by making it possible to write domain classes that the contain domain logic and nothing more.

Persistence isn’t however the only common infrastructure service that might affect how you write your classes. Others, such as databinding and serialization, sometimes require more than POCO types to work really well.

Simon Segal describes Entity Framework 4.0 Improvements in this 7/26/2009 post:

First up, let me just say that I’m quite pleased that my needs with respect to declaring my fetching intentions (eager and / or lazy), no longer will require the  assistance of PostSharp to get the job done. PostSharp is a great tool but I really shouldn’t have had to use it to achieve working the way I wanted to, therefore POCO is a welcome addition even if it does force me into some things such as choosing ICollection for 1..M navigable relationships within my Domain Model (only if you want to use change tracking proxies).

I am not going to regurgitate the changes here, for a complete list of the changes and new features see the ADO.Net Team blog.

There seem to be several points along an axis of how POCO you can choose to be with Entity Framework 4.0. At this stage I have the feeling that I will fall into the camp that probably wont use the proxies for change tracking but I will reserve judgement on that and perhaps that decision will be best left as a case by case assessment for some. …


Noah Hart sent the following e-mail on 8/6/2009:

Just wanted to let you know that the project is back up at under the name C#-SQLite

FYI, A clarification, if other emails, Richard expresses to me that his concern was more about confusion and support being sent to him, than about the trademark issue.

Noah Hart removed his C# port of SQLite from on 8/2/2009 as the result of the following email request by D. Richard Hipp, the primary author and registered owner of the SQLite trade mark (in part):

… Please also note that the SQLite source code is in the public domain, but the "SQLite" name is not. SQLite is a registered trade mark. If I don't defend the trademark, then I could lose it. So, I really do need to insist that you not use the name "SQLite" for your product. …

Noah responded:

Until this is done, I've removed access to the source code and will terminate this [G]oogle [C]ode project.  I'll post a link to the new project in the future. If anyone has a suggestion about what to call it, please let me know.

Although I’m not a vocal supporter of the concept of free and open software (FOSS), my take on this issue is that registering a trademark for the common name of an open-source software product is antithetical to the concept of FOSS.

LINQ to Objects, LINQ to XML, et al.

No significant new posts as of 8/1/2009 2:30 PM PDT 

ADO.NET Data Services (Astoria)

Mike Flasko’s Using Server Driven Paging post of 8/1/2009 reports:

In a recent episode of the 10-4 show, Jonathan Carter walks through one of the new features coming in the next version of ADO.NET Data Services known as "Server Driven Paging".  You can find the video here:

Robert Maclean offers an illustrated ADO.NET Data Services Cheat Sheet:

ASP.NET Dynamic Data (DD)

Steve Naughton’s Dynamic Data Custom Field Template – Values List, Take 2 post of 7/28/2009 demonstrates:

An alternative way of doing the Dynamic Data Custom Field Template – Values List this version uses the UIHint’s ControlParameters property to pass in values to the control.

Miscellaneous (WPF, WCF, MVC, Silverlight, etc.)

Rick Anderson adds Using DataAnnotations in MVC 2 - Catching up to Dynamic Data on 8/1/2009:


DataAnnotations help you write robust validation and prevent the type of annoying error message shown above. Form submittal failure when a field doesn’t validate can be very frustrating -  especially when there is no indication of the problematic property or the constraint violation. I happened to get the Outlook error above when I attempted to submit a mail message to the MVC QA guys. It turns out the distribution list I made for them a few days earlier had problems.

Scott Guthrie announces ASP.NET MVC V2 Preview 1 Released in this 7/31/2009 post:

Today’s preview works with .NET 3.5 SP1 and VS 2008, and can be installed side-by-side on the same machine as ASP.NET MVC 1.0 (meaning they don’t conflict and your existing ASP.NET MVC 1.0 projects will not be impacted if you install it).  If you have both ASP.NET MVC 1.0 and ASP.NET MVC 2.0 installed you’ll see two ASP.NET MVC project templates within Visual Studio 2008’s “New Project” dialog:

The release notes that come with the ASP.NET MVC 2 Preview release detail how to upgrade existing ASP.NET MVC 1.0 projects to use V2 if you’d like to migrate them forward to take advantage of the new features.

Scott then provides a detailed explanation of the new features in ASP.NET MVC 2.

Rick Anderson describes Using DataAnnotations in MVC2 on 7/31/2009:

DataAnnotations help you write robust validation and prevent the type of annoying error message shown above. Form submittal failure when a field doesn’t validate can be very frustrating -  especially when there is no indication of the problematic property or the constraint violation. I happened to get the Outlook error above when I attempted to submit a mail message to the MVC QA guys. It turns out the distribution list I made for them a few days earlier had problems.

David Ebbo warns C# method overload resolution can play tricks on you in this 7/31/2009 post:

While working on T4MVC, I ran into a very tricky C# compiler behavior that I thought I’d share.  T4MVC creates various overloads that allow you to avoid literal strings. …

David Ebbo’s T4MVC 2.4 updates: settings file, sub view folders, ActionName support and more post of 7/28/2009 suggests:

To get the latest build of T4MVC: Go to download page on CodePlex

This post is a continuation of various previous posts on the T4MVC template for ASP.NET MVC:

I last blogged about version 2.2, and there have been a number of changes since that (you can get the full history at the top of the file).  This post describes some of those changes.

Entity Framework, Entity Data Model, EDM, LINQ to SQL, LINQ, ADO.NET Data Services, Astoria Project, ASP.NET Dynamic Data, WPF, WCF, MVC, Silverlight 2

blog comments powered by Disqus