Sunday, September 07, 2008

LINQ and Entity Framework Posts for 9/2/2008+

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

•••• Updated 9/6/2008 5:00 PM PDT
••• Updated 9/5/2008 2:00 PM PDT
•• Updated 9/4/2008 12:40 PM PDT
• Updated 9/3/2008 11:40 AM PDT

Entity Framework and Entity Data Model (EF/EDM)

••• David Sceppa says in his SQLite's ADO.NET Provider Supports the ADO.NET Entity Framework! post of 9/6/2008:

[T]he initial build of the SQLite provider that supported the RTM version of the Entity Framework was available the same day that the Entity Framework released.

According to the PhxSoftware site, SQLite for ADO.NET 2.0 v3.6.2 of 8/30/2008 (build 1.0.58.0 on SourceForge.Net):

System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0 provider all rolled into a single mixed mode assembly.  It is a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll).  Unlike normal mixed assemblies, it has no linker dependency on the .NET runtime so it can be distributed independently of .NET.

However, the site offers the following caveat about EF:

Support for the ADO.NET 3.5 Entity Framework
SQLite's EF provider is still in beta for now, but go ahead and kick the tires!

PhxSoftware should confirm support for EF RTM, not a beta version.

Note: SQLite is the local database engine for Google Gears and several other technologies. According to Robert Accettura’s The Winner For Most Embedded Is: SQLite post of 2/27/2008:

What is interesting is that SQLite really dominates [the embedded database market] right now. Adobe Air, Mozilla Prism, Google Gears, Android, iPhone SDK (likely through Core Data API), Symbian, Ruby On Rails (default DB in 2.0), PHP 5 (bundled but disabled in PHP.ini by default).

I question whether a lightweight database engine (redistributable = 600 KB) justifies a heavyweight data layer, such as EF.

For more information on the SQLite database engine, go to http://www.sqlite.org/.

•••• Kathleen Dollard explains how to Customize Code Generation in EF in her “Ask Kathleen” column for Visual Studio Magazine’s September 2008 issue. She shows how to customize the EF team’s SampleEdmxCodeGenerator to remove the default DataMember attribute to specific properties of EF EntityObjects so the DataContractSerializer ignores them. The process is by no means a walk in the park and is a tribute to Kathleen’s analytical and coding prowess.

••• David Sceppa announces in his Devart's New Providers Support the ADO.NET Entity Framework! post of 9/5/2008 that Devart (formerly Core Laboratories) is the first third-party Entity Framework data provider to support the VS 2008 SP1 RTM implementation. For more information see Devart’s New Versions of ADO.NET Data Providers Available! post for:

•• Diego Vega updated the ADO.NET Entity Framework & LINQ to Relational Data wiki on 9/4/2008 to note that all Entity Framework Toolkits & Extensions have been updated to VS 2008 SP1 RTM except Danny Simmons’ Perseus (EntityBag) project.

So far, there’s no word from Danny about his intention to update the project.

Andrew Peters will be a developer on the Entity Framework team, according to his Joining Microsoft post of 9/2/2008. Andrew is a cofounder of Mindscape, a software solutions provider in Wellington, NZ, and the initial force behind the LightSpeed object/relational management (O/RM) tool.

Andrew will be working with fellow Kiwi, Alex James, EF’s Metadata program manager, but from the Microsoft Canada Developer Center in Vancouver, BC, because he missed this year’s H1B visa cutoff. (Damien Guard, a member of the LINQ to SQL team, also has temporary duty in Vancouver.)

Kristofer Andersson’s Tools - Part 5 - Add-ins - Documentation features in Entity Framework vs Linq-to-SQL of 9/2/2008 praises the EF team for including documentation for classes and their property. However, he faults the group for not using the entity’s Summary description for EntitySets and/or enabling editing it in the designer. I agree with Kris that the default “There are no comments for [name] in the schema” is “redundant and waste of screen real estate.”

See the related entry in the “LINQ to SQL” category.

Muhammad Mosa’s LINQ to Entities, Workarounds on what is not supported post of 9/2/2008 handles the EF features he found missing in his earlier LINQ to Entities, what is not supported? post of 8/24/2008 by:

  • Using Business objects as Wrappers for Entity objects
  • Converting to client evaluation, LINQ to Objects way

LINQ to SQL

Scott Guthrie resumes posting about ASP.NET MVC with LINQ to SQL as the data source in his very lengthy ASP.NET MVC Preview 5 and Form Posting Scenarios of 9/2/2008. I estimate the blog to be at least 42 screens long (i.e., classic Guthrie detail).

Kristofer Andersson describes the Huagati DBML Tools add-in’s new documentation feature for LINQ to SQL in his Tools - Part 5 - Add-ins - Documentation features in Entity Framework vs Linq-to-SQL post of 9/2/2008.

The add-in provides a new “Update Linq-to-SQL documentation from database” menu choice that imports the Description property of tables and columns as “summary xml comments and description attributes for all entities/classes, members/properties and data context entity accessor properties.”

Daniel Crenna has reached part four of his series that demonstrates using LINQ to SQL as the data transfer layer for a WCF service consumed by Silverlight following are links to the current and three previous members:

Dan’s From ASP.NET to Silverlight in Five Leaps of 7/25/2008 describes the five major differences between developing in ASP.NET and Silverlight.

LINQ to Objects, LINQ to XML, et al.

•••• Eric White’s Announcing the First CTP of Open XML SDK V2 reports the availability of the new OOXML SDK that includes the following new features:

  • Strongly typed document object model (DOM).

  • Tool to compare two Open XML files.

  • Class explorer that helps you understand the markup and determine which classes to use in the strongly typed DOM.

  • Document reflector that can write a lot of your code for generating documents or content.

Eric explains the benefits of the strongly typed DOM with LINQ to XML:

The gist of the strongly typed DOM is that the SDK defines classes for elements in the markup. When you access the contents of a part, you access via these class. For example, instead of retrieving a collection of System.Xml.Linq.XElement objects for the paragraph (w:p) elements, you retrieve a collection of DocumentFormat.OpenXml.Wordprocessing.Paragraph objects.

and provides small examples that compare the weakly and strongly typed with LINQ to XML.

•• Diego Lopez Ruiz suggests using additional XML technologies with LINQ to XML in his LINQ to XML, XmlReader, XmlWriter - more than meets the eye tidbit of 9/5/2008.

•• LinqMaster’s Using LINQ ElementAt and LINQ ElementAtOrDefault post of 9/4/2008 explains the syntax of these two LINQ extension methods.

•• Lisa Feigenbaum has just returned from an around-the-world tour giving VB presentations. She’s posted descriptions and materials for these two LINQ-related sessions she gave at Tech*Ed SouthEast Asia 2008:

in her Visual Basic at TechEd SouthEast Asia (Lisa Feigenbaum) post of 9/3/2008.

Amanda Silver, Lino Tadros, Steve Lasker, Erick Thompson, and Charlie Calvert discuss LINQ in the UI Layer with Carl Franklin in this panel interview. Here’s the description:

LINQ is commonly known as a great way to query data from external sources (databases, Web services, XML, SharePoint, etc). However, there are numerous other places where LINQ can make the developer's life much easier when working on the end user interface, especially when you incorporate DataSet into the mix. This panel will talk about these approaches and the possible pitfalls of using them.

Bart De Smet offers translation of LINQ expression syntax to LINQ method calls in his C# 3.0 Query Expression Translation Cheat Sheet post of 8/30/2008.

ADO.NET Data Services (Astoria)

•••• Mike Flasko reports in his 0 to 60 With ADO.NET Data Services post of 9/5/2008 that he’s updated his “Using Microsoft ADO.NET Data Services” white paper for VS 2008 SP1. Following are a few of the more important topics of the whitepaper:

  • Creating a Data Service using the ADO.NET Entity Framework
  • Creating a data service from any data source (from a CLR object graph)
  • Trying an ADO.NET Data Service (in the browser)
  • Finding and Pointing to Data: URLs in Data Services
  • Expression Syntax
  • Options for Data Representation (AtomPub, JSON)
  • Changing Data in ADO.NET Data Services
  • Optimistic concurrency
  • Custom Behaviors on Data Services
  • AJAX Applications
  • Language Integrated Query (LINQ to ADO.NET Data Services)
  • Using the client library from Microsoft Silverlight 2
  • Controlling Data Service Policies

Unsurprisingly, there’s no mention of LINQ to SQL as an Astoria data source in this white paper.

••• Shawn Wildermuth’s My Silverlight 2 Data Services Article Code Updated post of 9/4/2008 announces the availability of updated code for his Silverlight 2 MSDN Magazine article in the September 2008 issue. He also includes links to these three updated versions on his new Silverlight Data site:

  • Simple Example: Single page, three-table schema example that reads and writes data via ADO.NET Data Services and Entity Framework.
  • NHibernate Example: Single page, three-table schema example that reads and writes data via ADO.NET Data Services and NHibernate's new NHibernate.LINQ provider.
  • AG Games (Down for Maintenance): A more complex example using a richer Entity Framework model with complex mapping, data templates, multiple entity read/writing.

• Phani Raj announces an Interim Release: Making SL2 Beta 2 Clients Work With .NET Fx 3.5 SP1 RTM Servers on 9/2/2008. The new release solves the interoperability problem between Astoria RTM in VS 2008 SP1 and Silverlight 2 Beta 2 that Shawn reported in his post below.

• Rick Strahl warns about JSON UTC date encoding issues that might affect Astoria users in his Watch out for Date Kind in JSON Deserialization post of 9/3/2008.

• Roger Jennings: Out-of-band update 9/3/2008 4:45 PM PDT.

Shawn’s sample code works fine with VS 2008 SP1 RTM, and Silverlight 2 Beta 2 runtime, SDK, and VS 2008 Silverlight Tools when you replace the SL2 Beta 2 version of System.Data.Services.Client.dll with the interim release from today’s Astoria Project post.

Two or three fixes required:

  1. Replace opResponse.HasErrors with opResponse.Error !=null in ProductList.cs line 121 (and similar for VB)
  2. Replace EntitySetRights.WriteUpdate with EntitySetRights.WriteReplace in Products.svc line 20 (and similar for VB)
  3. If you’re using SQL Server Express, replace DataSource=.; with Data Source=.\SQLEXPRESS; in Web.config

Shawn Wildermuth warns readers of his “Create Data-Centric Web Applications With Silverlight 2” article for the MSDN Magazine’s September 2008 issue that his code examples require VS 2008 SP1 Beta and Silverlight 2 Beta 2 in “Caveats About My Silverlight 2 Data Services Article.” VS 2008 SP1 RTM won’t work.

He promises to update the sample code, which uses ADO.NET Data Services as its WCF-enabled data source, when Silverlight RTM becomes available.

ASP.NET Dynamic Data (DD)

•••• Matt Berseth shows you how to customize the default confirmation message box for deleting an entity instance with details about the item you’re deleting in his Dynamic Data - Customizing the Delete Confirmation Dialog post of 9/7/2008. Here’s a sample (courtesy of Matt):

•••• Steve Naughton posts the code for all seven parts of his FieldTemplate Septet (with apologies to Lawrence Durrell):

  1. The Anatomy of a FieldTemplate.
  2. Your First FieldTemplate.
  3. An Advanced FieldTemplate.
  4. A Second Advanced FieldTemplate.
  5. An Advanced FieldTemplate with a GridView.
  6. An Advanced FieldTemplate with a DetailsView.
  7. An Advanced FieldTemplate with a GridView/DetailsView Project.

in preceding link #7’s page of 9/6/2008.

••• Steve Naughton discovers in his Dynamic Data Futures – Part 2 - AnyColumn Filter post of 9/5/2008 that creating the AnyColumn filter from the Dynamic Data Futures Integer filter just requires you to “add the filter attribute Integer to the property you want filtered,” which make for a much shorter than usual article.

•• Steve Naughton explains how to display and edit multiple fields in a custom FieldTemplate in his Dynamic Data Compound Column post of 9/4/2008. He uses a compound Point(x, y) type as a Coordinate property for his tutorial. Steve says:

At a later date I would like to try this with Point being a User Def[in]ed Type in SQL Server 2005/2008, this would get rid of the need for the compound property and would mean only a new FieldTemplate was required.

• Steve Naughton, true to his word, posted part 1 of Dynamic Data Futures - Advanced Filters, Getting Dynamic Data Futures filters working in File Based Website, on 9/3/2008. The post is a lavishly illustrated, step-by-step tutorial that covers these topics:

  1. Adding Dynamic Data Futures to your Website
  2. Adding a Reference to Dynamic Data Futures and AjaxToolkit
  3. Adding the new Filter User Controls to the Website
  4. Converting Web Application files to work in a file based Website
  5. Making Necessary Changes to allow Advanced Filter to Work
  6. Testing the AdvancedFilterRepeater and new Filters

I wouldn’t try installing Dynamic Data Futures to a file-based Web site without this article.

Steve Naughton reports that he’s back from vacation  in Normal Service Resumed of 9/2/2008. However, he worked on the following new episodes in his series of DD improvements and will publish them shortly:

  • How to get the new Advanced Filters component of DD Futures working in a file based website.
  • Making an Any Column Filter (Works on any column not just FK columns)
  • Adding Insert facility to my GridView FieldTemplate.
  • A Time entry control and FieldTemplate.

SQL Server Data Services (SSDS)

••• Roger Jennings’ Microsoft Introduces Data Minining “Cloud Services” post of 9/4/2005 says the new online Table Analysis Tools for data mining appear to be a conventional Web service or Software as a Service (SaaS) application, not a “cloud service.”

However, hooking SSDS as the data service for the tools might qualify them for “cloud computing” status.

Ryan Dunn posted PhluffyFotos v2 Released on 9/4/2008. According to Ryan:

This sample application is a ASP.NET MVC and Windows Mobile application showing how to build a photo tagging and sharing site using our cloud data service, SSDS.

Following are abbreviated descriptions of v2’s new features:

  • Updated to MVC Preview 4
  • Updated to add thumbnail support
  • Updated to use the SSDS blob support 
  • Updated to use the latest SSDS REST library

Ryan adds:

The sample is available for download at CodePlex, and a live version is available to play with at PhluffyFotos.com.  I am opening this one up to the public to upload photos.  Maybe I am playing with fire here, so we will see how well it goes.

Ryan Dunn announces in his SSDS REST Library v2 Released post of 9/4/2008 that the new REST-based library for SSDS available from the MSDN Code Gallery’s SSDS REST Library offers the following new features:

  • Concurrency support via Etags and If-Match, If-None-Match headers
  • Blob support
  • Parallelization support via extension methods
  • Bug fixes
  • Better test coverage

See Ryan’s post for more details on the added features.

Roger JenningsHow To Get a List of Your SSDS Account’s Authorities post of 9/4/2008 answers a question that Mike Amundsen and I asked in the How do I get a list of my defined Authorities? thread of the SQL Server Data Services (SSDS) - Getting Started forum.

Pat Helland analyzes Amazon S3’s recent outage and suggests what’s required for cloud-based data reliability in his lengthy Confidence in the Cloud post of 9/1/2008. Topics include:

  • Some Observations about Reliable Process Pairs
  • Less Is More
  • N-Version Programming
  • Availability Over Consistency
  • Eventual Consistency
  • Front-Ending the Cloud
  • It's Going To Be a Fun Ride!

He concludes:

It is my opinion that we will be designing systems to support eventual consistency.  Part of this trend will be to back away from our traditional separation of storage (e.g. database) from applications.

The SSDS team touts immediate (ACID, transactional) consistency as one of the primary selling points of SQL Server Data Services.

(Pat left his job as a data architect at Microsoft to join Amazon and returned to Microsoft in March 2007 and ultimately joined the SQL Server data programmability group.)

Note: If you haven’t been to downtown Chicago for a few years (like me), check out Pat’s photographs in A Wonderful Few Days at a Wedding in Chicago of the same date.

SQL Server Compact (SSCE) 3.5 and Sync Services

• Aaron Greene, Andrei Maksimenka and Christian Liensberger “dig into the details of the Sync Framework and explore the complexities of sync, generally” in Channel9’s one-hour Synchronizing Data: Inside the Microsoft Sync Framework video segment. The description starts with:

The Microsoft Sync Framework is a comprehensive synchronization platform that enables collaboration and offline scenarios for applications, services and devices. It supports any kind of data type and any kind of data store. The framework was designed to be transfer protocol independent and to allow the developers to map any kind of network topology.

Visual Studio 2008 Service Pack 1 (General)

No new posts as of 9/2/2008 2:00 PM PDT 

Miscellaneous (WPF, WCF, Silverlight, etc.)

•• Beth Massi demonstrates how to incorporate a Windows-form DataGridView control in a WPF form by using the WindowsFormHost control in her Editing Tabular Data in WPF Using the Winforms DataGridView post of 9/4/2008.

• Rob Conery is updating his MVC Storefront project to Preview 5, as noted in MVC Storefront: Intermission 2 of 9/3/2008.

Roger Jennings decries Google Chrome’s draconian end-user license agreement in Chrome’s Evil Terms of [Software as a] Service of 9/3/2008. Other sources (ReadWriteWeb, The Register) cite mandatory copyright licensing, but there’s much more to fear when you read all the fine print. (Chrome is uninstalled here.)

• Derik Whittaker’s Upgrading Dimecasts.Net from MVC Preview 4 to Preview 5 post of 9/3/2008 expands on Casey Charlton’s post below.

Casey Charlton describes seven Problems Upgrading ASP.NET MVC to Preview 5 in this post of 9/2/2008.

Roger Jennings gripes about Technorati’s missing entries for the OakLeaf Blog’s new posts in his Technorati Fails to Index OakLeaf Systems Blog Posts complaint of 9/2/2008

WebSlice Content for Internet Explorer 8 Beta 2

OakLeaf LINQ and Entity Framework Links

Last Updated: 9/4/2008 12:40 PM PDT

  • Entity Framework Additions
  • LINQ to Objects, XML, etc. Additions
  • ADO.NET Data Services Additions
  • ASP.NET Dynamic Data Additions
  • SSDS REST Library V2

0 comments: