Saturday, January 03, 2009

LINQ and Entity Framework Posts for 12/29/2008+

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

Happy New Year! y Feliz Ano Nuevo

• Updated 1/1/2008 12:00 PM PST: Additions to Astoria, ASP.NET Dynamic Data, and Azure

• Updated 1/3/2008 9:00 AM PST: Azure, SQL Data Services (SDS) and Cloud Computing topic moved to Azure and Cloud Computing Posts for 12/29/2008+, additions to ASP.NET Dynamic Data

Entity Framework and Entity Data Model (EF/EDM)

Julie Lerman’s EF Designer Bug Workaround for 0..1 Associations to Derived Types (Error Code 3034) post of 12/30/2008 solves the problem that occurs “when creating associations where one of the ends is a 0..1 (zero or one) and one of the entities involved is derived from another entity” and error 3034 tells you “that two columns were mapped to the same row.”

Great sleuthing, Julie!

Anne Epstein describes The benefit of writing mapping files by hand in a follow-up post of 12/29/2008 to her previously-reported NHibernate and Entity Framework Battle it Out in the Real World post of 12/3/2008. The earlier post discussed her team’s decision to adopt NHibernate rather than EF and attracted comments by Scott Bellware and others. The current post discusses problems with the graphical approach to mapping with EF’s graphical designer and how writing NHibernate mapping files by hand resulted in improvements to the domain model.

Justin Etheredge’s Making the Entity Framework Fit Your Domain - Part 1 post of 12/29/2008 is a detailed start to a series in which he explores the Entity Framework to see if he can “make it palatable for [him] to use.” Justin says:

My goal with this post is not to trash talk the entity framework, but instead to take it as far as I can toward a usable solution that I would be okay with putting into a production application. This post is going to be written as I explore, so please let me know if you see anything that is wrong or missing.

And concludes:

In future parts of this series we will break down the base entity class that I have created and take a look at the different entities and how we can create them. We will also take a look at creating an ObjectContext and show you how we can use and query these entities just like we could if we created them through the EDM designer.

[Repeated from last week’s post]


No significant new posts as of 12/30/2008 8:00 AM PST. 

LINQ to Objects, LINQ to XML, et al.

Jim Wooley’s Adding a dynamic SiteMap for search engine optimization using LINQ post of 1/3/2009 describes how he use LINQ to XML with VB’s XML literals to add a SiteMap to his ThinkLinq Web site.

Eric White begins the New Year with Writing Succinct Code to move XElement and XAttribute Objects to One LINQ to XML Tree from Another of 1/1/2009. Eric explains:

There is an interesting idiom of LINQ to XML that makes it easy to write short, succinct code when creating one XML tree from another. Many folks are not aware of this idiom, but it is a useful and convenient trick. I documented this idiom in the LINQ to XML documentation, however, it is worthwhile to discuss in a blog post. This post describes this idiom in detail.

Eric White suggests that you Align Attributes when Formatting XML using LINQ to XML in his post of 12/29/2008. Eric says:

Sometimes an XML element contains a large number of attributes, and the values of the attributes may be long. When written to the console, such lines wrap, making it hard to read the XML.  In particular, the XML responses from SharePoint web services often contain many attributes for each element.  However, you can use appropriate settings for an XmlWriter so that the attributes are aligned, and each attribute is on a separate line. This post shows how to do this.

Jon Udell’s Databasing trusted feeds with post of 12/29/2008 tentatively uses LINQ to XML for “maintaining lists of the Eventful and Flickr accounts that I consider trusted sources for the event and photo streams” for deployment as an Azure project.

ADO.NET Data Services (Astoria)

Roger JenningsBreaking ADO.NET Issues with .NET 3.5 SP1 Fixed by Update KB959209 of 12/20/2008 post of 12/31/2008 describes a hotfix to solve a common problem that the ADO.NET Data Services client has with foreign key table constraints.

ASP.NET Dynamic Data (DD)

•• Steve Naughton provides a fully-illustrated tutorial for Josh Heyes’ Dynamic Data Filtering CodePlex project in his Dynamic Data Filtering – Installation post of 1/2/2009. Steve’s article is slightly mis-named because it includes the following topics:

  1. Installation
  2. Adding Dynamic Data Filtering to your site
  3. Working with the DynamicFilterRepeater and the DynamicFilterForm
  4. Dynamic Data Filtering working with classic Filters and Filters from the Dynamic Data Futures project.
  5. Creating and adding custom filters
  6. Adding default values to filters

Rick Anderson’s Custom Validation Error message not displayed post of 12/31/2008 provides a workaround for an ASO.NET Dynamic Data bug that causes error messages in another language to appear in English.

Roger JenningsBreaking ADO.NET Issues with .NET 3.5 SP1 Fixed by Update KB959209 of 12/20/2008 post of 12/31/2008 describes a hotfix to solve a problem that ASP.NET Dynamic Data has with navigating one-to-one relationships.

Steve Naughton spent part of his New Year’s Day writing Dynamic Data – Registering Multiple Models, which demonstrates two ways “to get multiple model into your site:”

  1. Register Multiple DataContexts with the default Model
  2. Register each DataContext with it’s own Model

Azure, SQL Data Services (SDS) and Cloud Computing

This content has moved to a new Azure and Cloud Computing Posts for MM/DD/YYYY series starting with Azure and Cloud Computing Posts for 12/29/2008+ on 1/3/2009.

SQL Server Compact (SSCE) 3.5 and Sync Services

This section will be dropped after 12/31/2008.

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

Simon Segal’s Why I want Silverlight to succeed in a huge way - [A new year wish]. post of 1/1/2009 complains about the requirement for ASP.NET developers to be proficient with CSS, JavaScript, Ajax, JSON, JQuery, DHTML, MVC, and other tools in order to develop public-facing Web projects. Simon says Silverlight simplifies the situation:

Microsoft have invested heavily in UI frameworks grounded in the XAML which offers perhaps the first real opportunity we have seen for a unification of a single set of skills to be employed both across the web and desktop. …

If I can affect a streamlining of my team by leveraging XAML via WPF and Silverlight and work richly on the web and desktop and avoid the toolkit soup that comes with browser development, then I will be a happy man - a very happy man.

• Shawn Wildermuth continues his MSchema tutorial with MSchema: An Example - Part 3 of 12/31/2008 that explains how to use Oslo’s m.exe tool to compile the students.m schema file into an SQL Server database and the mx.exe tool to push the data defined in the studentsdata.m mGraph file into the database.

Aaron Skonnard’s Screencast: Configuring MEX endpoints post of 12/30/2008 describes “how to configure your WCF services with Metadata Exchange (MEX) endpoints - both over HTTP and TCP - allowing consumers to automatically retrieve metadata from your services at runtime.”

Shawn Wildermuth demonstrates how to write MSchema files for creating types, collections and constraints, as well as database schema in his MSchema: An Example - Part 1 post of 12/28/2008. His MSchema: An Example - Part 2 post 12/29/2008 demonstrates using the MGraph language to create instances for data for his model.