Thursday, June 12, 2008

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

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

Updated 6/11/2008 and 6/13/2008: See Added and Updated flags below.

Eugenio Pace Posts a New SQL Server Data Services Sample: A Provider for BlogEngine.NET

Eugenio’s Another SSDS sample: BlogEngine.NET on SSDS post of June 11, 2008 describes his SQL Server Data Services (SSDS) provider’s source code for the BlogEngine.NET 1.3.1 ASP.NET blog project as follows:

  1. The SSDS based BlogProvider
  2. An SSDS based Membership & Role Providers for the web site
  3. Unit tests for all (with about 93% coverage for the provider)
  4. A simple tool for pre-loading the SSDS container with information that BlogEngine need to start

He also says “The new SSDS BlogProvider also uses patterns & practices Unity application block to wire up dependencies.”

It’s related to the SSDS demo in Bill Gates’ Tech*Ed keynote and definitely worth a trial run.

Added: 6/13/2008

Phil Haack Promises Future Posts about Integrating Web Forms with MVC

He says in ASP.NET MVC And Dynamic Data Learn To Play Well Together of June 11, 2008:

I’ve been working on a post detailing a couple different ways to integrate WebForms and MVC, but life has been really busy for me lately. Hopefully I’ll get that to you soon.

In the meanwhile, you can probably learn all you need to know by looking at [ on this Code Gallery page.]

Added: 6/13/2008

Jim Wooley Demos LINQ to SQL with Plain Old CLR Objects (POCO) During the Tech*Ed Tweener Weekend

Jim’s LINQ to SQL support for POCO post of June 11, 2008 describes his Tweener demo as follows:

I created two separate projects. The first class library project, I created only targeting the 2.0 framework. As a result the project can not use any LINQ specific techniques. This will also allow us to consume the resulting objects in projects that do not have access to the newer framework, or to all of the namespaces. This is particularly important in cases like Silverlight. To call attention to the differences in the projects, I declared the 2.0 project in C# and the LINQ enabled project in VB.

His post includes a link to download the demo projects.

He also posted a link to his Tech*Ed Speaker Idol presentation, Screen scraping and creating Word documents with LINQ to XML.

Added: 6/13/2008

Julie Lerman Wants a Simpler Implentation of “Eager Deferred Loading” in Entity Framework

Danny Simmons provided an example of combining the Attach() and Include() methods with the CreateSourceQuery() surrogate for the Load method to return associated child and grandchild records in the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum’s Re: v2 Wish Lists - Add Yours Here thread.

Julie says in her Eager Deferred Loading of related entities post of June 11, 2008, that customer.Orders.Attach(customer.Orders.CreateSourceQuery().Include("Order_Details")) is “awfully convoluted,” but it works.

Added: 6/11/2008

Rob Conery Does MVC Storefront Part 14 with AJAX Control Toolkit and a Narrative Preview of IQueryable<T> in SubSonic 3.0

The screencast of Rob’s MVC Storefront Part 14: Ajax With Shawn Burke post of June 10, 2008 introduces ASP.NET AJAX to his MVC project to provide async form posting. Rob mentions that Phil Haack is in the process of AJAX-enabling the ASP.MVC library, so Rob’s code will be obsolete in a few months.

In SubSonic 3.0: IQueryable Update of the same date, Rob discusses the challenges of writing an expression tree with a visitor to translate LINQ Select queries to his SubSonic intermediate query language, thanks to Matt Warren’s Building an IQueryable Provider: Part II - Where and reusable Expression tree visitor post of July 31, 2007. Everyone working on LINQ-enabled data providers for databases or object/relational management (O/RM) tools is indebted to Matt for his detailed seven-part series.

Added: 6/11/2008

Maíra Wenzel Shows You How to Create Your Own Custom Metadata Attributes for ASP.NET Dynamic Data Entity Sets or Properties

Maíra’s Using custom attributes in Dynamic Data post of June 4, 2008 explains the process for writing and consuming custom metadata attribute classes by inheriting from Attribute and applying the AttributeUsage attribute. Her example changes the ForeColor of a property to a member of the KnownColor enumeration.

Added: 6/11/2008

Tech*Ed 2008 Panel Presentation: Occasionally Connected Systems

The following folks involved in occasionally connected systems (OCS) and ADO.NET Sync Systems:

  • Ginny Caughey - Microsoft MVP, Wasteworks
  • Steve Lasker - Sr. Program Manager, Microsoft SQL Server Compact
  • Rob Tiffany - Microsoft Mobility Architect
  • Rob Relyea - Architect, WPF Team
  • Liam Cavanagh - Sr. Program Manager, Microsoft Sync Framework

got together at Tech*Ed 2008 Developer to discuss storage, sync, programming model and UI for OCS. One of the new topics the panel discusses is republishing subscriptions for scalability.

The video is available here in multiple formats: Building Offline Enabled Applications [MP4] [WMV Hi] [WMV Lo]

Added: 6/11/2008

Scott Hunter Discusses the ASP.NET Dynamic Data Runtime on .NET Rocks

.NET Rocks Scott Hunter on Microsoft Dynamic Data (Show #349) post carries this deck:

Carl and Richard talk with Scott Hunter on Microsoft's Dynamic Data Runtime, which provides scaffolding and dynamic data services to developers.

ASP.NET Dynamic Data content starts at about 09:00.

At ~13:30, Scott mentions ADO.NET Data Services (Astoria) and LLBLGen Pro data layer for Dynamic Data and an intention to support NHibernate as a data layer. I don’t see an advantage to the use of Astoria, but support for LLBLGen Pro and NHibernate would be very welcome. You can read more about LLBLGen Pro support in Frans Bouma’s Dynamic Data and 3rd party o/r mappers is a fact post of May 1, 2008.

Scott Hanselman says the following about Dynamic Data and NHibernate:

In the future, watch for the possibility of Dynamic Data for POCO (my term, not the teams), Dynamic Data for Silverlight and Dynamic Data for MVC. Now is your opportunity to be heard. I'd like the idea of Dynamic Data for NHibernate myself, so I'm pushing for that. Feel free to engage in the Dynamic Data Forums or post bugs on this release in the issue tracker.

Scott Hunter confirms at ~47:00 that Dynamic Data for MVC is in the works for the next version.

Added: 6/10/2008 10:30 AM PDT

Updated 6/11/2008: Frans Bouma’s Dynamic Data and 3rd Party O/R Mappers Is a Fact post of May 1, 2008 described LLBL Gen Pro’s support for backing Dynamic Data. Frans is in the process of updating his sample provider to .NET 3.5 SP1 Beta.

Tim Anderson Misses the Point of My “Is the ADO.NET Team Abandoning LINQ to SQL?” Post

Tim’s Bet on ADO.NET Data Services, not LINQ to SQL post of June 10, 2008 starts:

So says Roger Jennings in his post Is the ADO.NET team abandoning LINQ to SQL? His main points in favour of ADO.NET Data Services (formerly Astoria):

  • It is the focus of more energetic development
  • It already has richer features
  • It supports multiple database engines, not just SQL Server

My post mentioned ADO.NET Data Services in passing as a client of Entity Framework (as is ASP.NET Dynamic Data.)

My point was that Entity Framework was a better bet than LINQ to SQL for a production object/relational mapping (O/RM) data layers because it’s getting the lions share of attention (and development resources) from SQL Server’s Data Programmability Group.

Update 6/11/2008: In a comment, Tim says he meant Entity Framework, not Astoria, and accidentally interchanged the two in his post. He changed the title and body of his updated post.

Paul Stovell Releases Bindable LINQ 1.0 Beta 1

Bindable LINQ is a LINQ to Objects implementation for Windows Presentation Foundation, Silverlight, and Windows Forms that provides data binding with collection change propagation. You can download the beta bits under a BSD license from CodePlex.

Paul's subsequent Bindable LINQ: Bindable Aggregates of June 10, 2008 provides insight on how Bindable LINQ responds to changes to LINQ aggregate values.

Note: WPF-oriented developers will appreciate Paul's detailed Article: Inductive UI’s with WPF Navigation Applications post of June 5, 2008, which was inspired by a Microsoft whitepaper, Inductive User Interface Guidelines, published in 2001.

Dare Obasanjo Takes on Joel Spolsky's Post About Live Mesh and Hailstorm

Hailstorm was the codename for .NET My Services, a heavily hyped but unsuccessful Web services initiative by Microsoft to make user data hosted on MSN available to the same users at other sites. Joel Spolsky's Architecture astronauts take over post of May 1, 2008 concludes that Live Mesh is Hailstorm reincarnated and doomed to failure because data synchronization "is just not a killer application."

Dare's Some Thoughts on Joel Spolsky's Live Mesh Rant of June 10, 2008 post points out:

Hailstorm has actually proven to have been a very visionary and accurate picture of how the world ended up. A lot of the information that used to sit in my desktop in 2001 is now in the cloud. My address book is on Facebook, my photos are on Windows Live Spaces and Flickr, my email is in Hotmail and Yahoo! Mail, while a lot of my documents are now on SkyDrive and Google Docs. Almost all of these services provide XML-based APIs for accessing my data and quite frankly I find it hard to distinguish the ideas behind a unified set of user-centric cloud APIs that was .NET My Services from Google GData.

He also notes that Mark Lucovsky is a former Microsoft employee who moved to Google. What Dare didn't mention is that Lucovsky was Hailstorm's architect and chief evangelist.

Frans Bouma Releases LLBLGen Pro v2.6 with Full LINQ Support

Frans' LLBLGen Pro v2.6 has been released! post of June 9, 2008 begins:

After almost 11 months of design, development, beta testing and adding final polish, it's here: LLBLGen Pro v2.6! This version, which is a free upgrade for all our v2.x customers, has a couple of major new features, the biggest of course being the full implementation of Linq support in our O/R mapper framework. The work on our Linq provider, which we've dubbed 'Linq to LLBLGen Pro', lasted almost 9 months and was discussed on this blog in a series of articles, which I'll linq to below.

He goes on to explain his problems with creating LINQ to LLBLGen Pro, lists what's new in v2.6, and adds links to the 15 detailed blog posts that chronicled his LINQ implementation.

Congrats, Frans!

Sync Framework Team Announces RC0 of Sync Framework and ADO.NET Sync Services in SQL Server 2008 RC0

The team’s Announcing Sync Framework v1.0 RC0 and Sync Services for ADO.NET v2.0 RC0 post of June 9, 2008 notes that SQL Server 2008 RC0 includes Sync Framework v 1.0 and Sync Services for ADO.NET 2.0 and provides the following download points for the SQL Server 2008 RC0:

There's no indication so far of availability of standalone bits that are compatible with SQL Server 2005.

Update 6/10/2008 3:15 PM PDT: Thanks to Mary Jo Foley for confirming that the Sync Framework will continue to be available as a standalone download.

Update 6/10/2008 10:30 AM PDT: According to the Data Platform Insider's SQL Server 2008 RC0 Available for Everyone post of June 10, 2008, Bob Muglia announced at Tech*Ed that everyone can download the RC0 and it's What’s New notes from:

  • Download SQL Server 2008 RC0
  • What's new in SQL Server 2008

    The team expects to release a CTP (Community Technology Preview) of the Sync Framework on devices in 2008Q3.

    Liam  Cavanagh Explains Hosted Services Synchronization in Gates's Tech*Ed Keynote

    Liam's Synchronization to Hosted Services and an Explanation of the Bill Gates Keynote post of June 9, 2008 points out that SQL Server Data Services (SSDS) was the central data storage point for synchronization of simulated blog posts between a local SQL Server instance and Windows Mobile devices.

    Mary Jo Foley Wonders Why It's Taken Microsoft So Long to Release Live Mesh

    Mary Jo's Are all (Microsoft and Apple) sync services created equal? post of June 9, 2008 says:

    Apple’s introduction of the successor to .Mac — a k a, MobileMe — raises the question as to what’s taking Microsoft so long to roll out Live Mesh.

    There aren’t a whole lot of details yet available on MobileMe, other than that it will allow cloud-based synchronization of data and devices. (And will make use of Microsoft’s ActiveSync technology, which Apple licensed from Microsoft in order to bring push e-mail to the iPhone, creating its “Exchange for the rest of us.”)

    From initial reports, MobileMe sounds like a combination of a Windows Live (the various Webified versions of the .Mac point products), Live Mesh (the Mobile Me sync service) and SkyDrive (the Mobile Me cloud-based storage). It is slated to be available to customers in July for a (pricey) $99, which includes 20 GB of storage.

    She also reports having a difficult time getting Microsoft executives to explain why Microsoft didn't use the Sync Framework for Live Mesh. She says:

    All I could get out of them was Live Mesh is the P2P, out-of-the-box sync solution and Sync Framework is the customizable, developer-focused sync solution. The only place (so far) where the two meet: FeedSync.

    Very strange.

    Note: Skydrive stores the ~500 images for this blog and has delivered them with no observed outages or performance issues. The only problem I've encountered is a brief interval (an hour or less) when I couldn't upload images; downloading wasn't affected.

    Skain Compares Several Techniques for Bulk Deletions with LINQ to SQL

    Skain's Bulk Deletes in Linq to SQL update to an April 8, 2008 post chronicles his search for a bulk deletion method for LINQ to SQL that doesn't retrieve each object into memory and delete it while executing the DataContext.DeleteAllOnSubmit() method.

    His final DataContext.BulkDelete() extension method provides a better solution, however there are references in the comments to alternative solutions.

    Coşkun Sunali Uses the LinqDataSource as a DataPager Workaround for the ListView Control

    His Using DataPager with Code-Behind Data Source post of June 9, 2008 says:

    Some of you might have already realized that DataPager does its job only if you use a DataSource control. For instance, if you want to set a ListView’s DataSource property in page’s Load event and expect DataPager control to successfully page the ListView control, it means that you will need to spend your hours to find why it does not work.

    Coşkun provides the simple source code for the workaround.

    Strange Exception Generated by Open File Dialog in a Windows Form Backed by the Entity Framework

    Sumeet reports in his Entity framework and OpenFileDialog post of June 8, 2008 that closing, not canceling, an OpenFileDialog in a Windows form of a project using the Entity Framework as a data access layer causes an exception on the next call to the ObjectContext.

    The problem appears to be a change to the Environment.CurrentDirectory property, which must be reset with an Environment.CurrentDirectory = Application.StartupPath instruction.

    John Papa Posts a Linklist to Silverlight 2 Beta 2 Resources

    John's Silverlight 2 Beta 2 Rundown post of June 8, 2008 provides 13 links to early Silverlight 2 Beta 2 Resources, including Shawn Wildermut's Using ADO.NET Data Services in Silverlight 2 Beta 2.

    Mike Tulty applauds John's list in his Silverlight 2 Beta 2 - What's New? post of June 9, 2008.

    DataGrid Breaking Changes and Behavior Differences in Silverlight 2 Beta 2

    The Silverlight SDK Team's DataGrid Control Beta 2 Changes of June 6, 2008 points to the DataGrid Beta 2 Breaking Changes post of the same date, but also includes behavior changes for Autogenerated Columns and Automatic Sizing.

    Note: A substantial amount of Silverlight 2 Beta 2 content is included in these posts because of the new Silverlight Client Library for ADO.NET Data Services.

    Shawn Wildermuth Explains How to Debug ADO.NET Data Services with Fiddler2

    Shawn's Debugging ADO.NET Data Services...with Fiddler2 of June 6, 2008 provides detailed instructions for using Fiddler2 with ADO.NET Data Services, including adding the period after the IP address to make localhost data appear.

    He concludes:

    One caveat, this is the first release of the ADO.NET Data Services' Silverlight Client Library so give it time to improve some of the performance issues.  But like other data access libraries, sometimes small changes can make large improvements in performance.

    Shawn also announced that he's updated the following Silverlight 2 sites and projects to Beta 2:

    Off-Topic: Windows Live Writer Technical Preview for Build 14 Appears Solid

    I've been posting with the Windows Live Writer (WLW) Technical Preview for build 14 since its release on June 2, 2008 and haven't encountered a problem so far.


    Tim Anderson said...


    Apologies; I wrote ADO.NET Data Services where I should have written Entity Framework; I do know the difference but it was careless on my part. I've fixed the post now and I hope it quotes you correctly; if not let me know.

    Thanks for the interesting post by the way.