Sunday, June 14, 2009

LINQ and Entity Framework Posts for 6/1/2009+

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

• Updated 6/14/2009: Additions for 6/1 to 6/7/2009 missed in original entries

Entity Framework and Entity Data Model (EF/EDM)

• Simon Segal straightens out a sample code mixup in his Entity Framework Repository and Fetching Strategies code update! post of 6/5/2009. Simon says:

It recently came to my attention that the code for this series of posts got entangled in a brain freeze mix up when I uploaded some zip files recently. Therefore the code is now located in the subversion repository.

And includes links to Parts 1 to 11 of his blog series as well as the reorganized source code.

Danny SimmonsLinks: EF4 Podcast, N-Tier Anti-Patterns, and some thoughts about DDD of 6/3/2009 contains links to:

Alex James posted Tip 22 - How to make Include really Include on 6/2/2009, which notes:

[I]f you start to do more interesting [Entity Framework] queries that change the ‘shape’ of the query, either by introducing an intermediary join or something, [t]he include no longer works.

And shows you the workaround.

Matthieu Mezil’s How to split your EDM v2? post of 6/2/2009 explains:

After my previous post about it, my customer asks me the following question: how to get a complete graph (with categories, suppliers, products, order details, orders, customers and employees)?

To realize it, we have to add “sort of” navigation properties for the entities like [his example]

Elisa Flasko reports ADO.NET Entity Framework Provider for Firebird RTM Now Available in this 6/1/2009 post.

LINQ to SQL

• Damien Guard’s LINQ to SQL resources post of 6/4/2009 provides:

A quick round-up of some useful LINQ to SQL related resources that are available for developers. I've not used everything on this list myself so don't take this as personal endorsement.

Resources are templates, blogs (including this one), tools, official guides, books (including my Pro ADO.NET 3.5 with LINQ), and support.

• Damien Guard provides a list of LINQ to SQL changes in .NET 4.0 in this 6/1/2009 post categorized by:

    • Performance
    • Usability
    • Query Stability
    • Update Stability
    • General Stability
    • SQL Metal
    • LINQ to SQL Class Designer
    • Code generation (SQL Metal + LINQ to SQL class designer)
    • Potentially breaking changes

Not sure why I missed these two articles on the first pass.

Jim Wooley offers a workaround for a *.dbml file upgrade bug in his LINQ to SQL designer in VS 2010 Beta 1 post of 6/2/2009.

Jim Wooley’s LINQ to SQL enhancements for 2010 post of 6/2/2009 details what’s not in the works for LINQ to SQL in the VS 2010 upgrade.

LINQ to Objects, LINQ to XML, et al.

• Jim Wooley announces that LINQ In Action Samples [are] available in LINQPad in this 6/6/2009 post. Jim writes:

Joe [Albahari] recently added [to LINQPad] the ability to integrate with other sample sources and offered the opportunity to Fabrice, Steve, and myself to have the samples from LINQ in Action available in LINQPad. Although we have all of our book samples available already, adding them to LINQPad offered the advantage of making it easier for you to try the queries and change them to learn better. You can then save your queries and re-run them later.

Marcelo Lopez Ruiz announced LINQ to XSD on CodePlex on 6/3/2009. Marcello writes:

I'm very, very pleased about today's announcement on LINQ to XSD being available on CodePlex.

The functionality available should be es[s]entially the same as what was released in the last Alpha Preview, so if you were already using this, it should be a smooth transition.

The community of developers interested in LINQ to XSD will now be able to include this in their applications, as it's being released under the Ms-PL license.

The CodePlex site is Spartan, to be generous.

My last post about LINQ to XSD, which I like immensely, was LINQ to XSD Redux and LINQ to Stored XML Coming of 12/4/2007. Perhaps LINQ to Stored XML will gain a CodePlex release some day.

Martin Honnen’s Exploiting covariance with LINQ to XML of 5/30/2009 and Exploiting contravariance with LINQ to XML of 5/31/2009 observe:

Covariance and contravariance for generic interfaces are new features in C# and VB.NET in Visual Studio 2010 respectively the .NET framework 4.0. Generic interfaces like IEnumerable<T> or IEqualityComparer<T> in the .NET framework 4.0 use these new features. Starting with .NET 4.0 the type parameter T in IEqualityComparer<T> is contravariant. That can make coding with LINQ to XML easier, as the class XNodeEqualityComparer implements IEqualityComparer<XNode> where XNode is a common base class for other LINQ to XML classes like XElement.

Damien Guard’s LINQ to SQL changes in .NET 4.0 post of 6/1/2009 list LINQ changes in these categories:

  • Performance
  • Usability
  • Query stability
  • Update stability
  • General stability
  • SQL Metal
  • LINQ to SQL class designer
  • Code generation (SQL Metal + LINQ to SQL class designer)
  • Potentially breaking changes

So Microsoft hasn't totally abandoned LINQ to SQL in favor of Entity Framework!

ADO.NET Data Services (Astoria)

Damien White’s ASP.NET AJAX 4.0 and the ScriptManager Control post of 6/1/2009 starts:

I have been using ASP.NET AJAX 4.0 quite a bit lately, as I’m sure most of you are aware from my recent posts.  In those posts, I used standard HTML script references to show that ASP.NET AJAX is not reliant upon ASP.NET.  I realize that many of you are in fact using ASP.NET, and today we will take a look at using the ScriptManager. 

First we’ll look at using the Preview 4 scripts within an ASP.NET 3.5 application (with the ScriptManager of course) as well as using client templates and ADO.NET Data Services with the ScriptManager in ASP.NET 4.0 (Beta 1).  After that, we’ll take a closer look at some of the new features of the ScriptManager in ASP.NET 4.0.

Damien White takes on ASP.NET 4.0 AJAX – Preview 4 – Data Binding in his 5/27/2009 post:

Throughout the course of my introductory posts on ASP.NET AJAX 4.0, we looked at the new DataView control as well as the Sys.Observer class, which brings the Observer pattern to plain JavaScript objects.  The new ASP.NET AJAX release is very exciting offering powerful new features to take AJAX enabled applications to a new level.  In this post, we’ll look at another exciting feature of ASP.NET AJAX 4.0 known as “live bindings.” 

You may remember that we looked briefly at live bindings in the client templates post, but for those examples I used one-way / one-time bindings.  Today, we’ll take a closer look at live bindings and see how two-way live bindings removes the one-way / one-time binding restriction allowing us to update bound elements on our page automatically when the underlying data changes. 

ASP.NET Dynamic Data (DD)

Steve Naughton points out A Great Buried Sample in Dynamic Data Preview 4 – Dynamic Data Futures on 6/3/2009:

I just thought I’d mention this find and David Ebbo mentioned overriding MetaTable to get at the table.GetScaffoldColumns() method, and then I found the Dynamic Data Futures sample inside of Preview 4 (which had a billing of being the Futures sample updated to work with Preview 4) and in side the it I found the CustomMetaClasses folder.

Rick Anderson describes Setting font attributes with UIHint in your Entity Partial Class in this 6/2/2009 post:

I've written a simple Field Template ( RedBold.ascx ) that reads most font attributes and applies them to your field values. The new entity templates make it easy to apply font attributes to the field labels. The image below shows several font attributes applied to the partial class for the Customer table of the AdventureWorksLT database. You can apply attributes (bold, italic, foreground color, background color, border style, border color, font name, etc) to the field name or the field value.

Steve Naughton’s  HTML Editor FieldTemplate for Dynamic Data Using AJAX Control Toolkit Editor post of 6/2/2009 begins:

I decided to create an HTML Edit FieldTemplate after the AJAX Control Toolkit HTML Editor was released and a post (Edit.aspx page hanging on text entry) on the ASP.Net Dynamic Data Forum was posted.

For this we will need two FieldTemplates:

  1. Html.ascx
  2. Html_Edit.ascx

The first of the two Html.ascx will display the HTML rendered correctly and the second will use the AJAX Control Toolkit HTML Editor.

David Ebbo describes ActionLink helpers in his A BuildProvider to simplify your ASP.NET MVC Action Links post of 6/1/2009.

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

No significant LINQ or EF-related posts in this category as of 6/3/2009 2:30 PM PDT.

0 comments: