Showing posts with label LINQ to NHibernate. Show all posts
Showing posts with label LINQ to NHibernate. Show all posts

Monday, January 26, 2009

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

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

• Update 1/23/2009: Minor additions
•• Update 1/26/2009 10:00 AM PST: Minor additions

Entity Framework and Entity Data Model (EF/EDM)

•• Greg Duncan’s LINQPad and the Entity Framework post of 1/25/2009 cites Simon Segal’s LinqPad for the Entity Framework, Shawn Wildermuth’s Using LinqPad and Entity Framework Models and Stefan Cruysberghs’ .NET - ADO.NET Entity Framework & LINQ to Entities – Part 2 – LINQPad post as evidence that using LINQPad with Entity Framework is “officially cool.”

•• Udi Dahan discusses issues with value objects, many:many associations and aggregated roots in his DDD & Many to Many Object Relational Mapping post of 1/24/2009.

• Sanjay Nagamangalam’s detailed Customizing Entity Classes in VS 2010 post of 1/23/2009 describes expected improvement to code generation in EF v2 and VS 2010.

• Julie Lerman reports that my new “LINQ and the Entity Framework” book from WROX/Wiley has reached Amazon.com in her Roger Jennings' ADO.NET 3.5 is now "In Stock" on Amazon! post of 1/23/2009. My post about the arrival is here.

• Julie Lerman’s EntityObject Class Constructors post of 1/22/2009 observes that the entity classes generated by the EDM Designer don’t have a default constructor. This lets you add your own constructor to set default values for foreign keys, which is supported in by the Designer.

Julie Lerman will present two sessions about Entity Framework at Philly.NET Wednesday night (Jan 21) - Thanks INETA.

David Klein’s Why the Oakton Microsoft Application Framework (OMAF) Will Not Be Moving to The Entity Framework (EF) 1.0 or any 3rd Party ORM Products Right Now post of 1/20/2009 explains why OMAF will stick with LINQ to SQL until the ADO.NET team releases EF v2.

Many comments to the ADO.NET Team’s Migrating from LINQ to SQL to the Entity Framework: Stored Procedures for data retrieval post of 12/4/2008 reflect sentiments similar to David’s.

Kristofer Andersson describes in his Tools - Part 9 - Add-ins - Filtering intellisense dropdowns on required vs optional members post of 1/21/2009 how he used Alex James’ “simple and elegant way to filter Visual Studio’s Intellisense dropdowns by using interfaces and properties returning those interfaces” in the latest version of his Huagati DBML/EDMX Tools.

A beta version of Huagati DBML/EDMX Tools version 1.60 including this new feature is available for download here. Kris writes:

Unlike the other features in the add-in, this feature don’t require any license/activation. You can use it with or without having a license for the other add-in features.

Ken Cox’s Learning CRUD and Data Forms in Silverlight 2, Creating a Silverlight 2 Data Form - Episode 1 and Creating a Silverlight 2 Data Form - Episode 2 posts of 1/19/2009 show:

[A] small, but realistic example of how to create a CRUD (Create, Read, Update, Delete) application against the familiar Northwind database. It uses the latest stuff from Microsoft including Windows Communication Foundation, ADO.NET Data Services (Astoria), and the Entity Framework.

Ken uses VB because, in his words:

“I’m more comfortable in VB (although I write lots of C#); there’s a dearth of sample Silverlight code in VB; and people who write only in C# don’t need beginner-level content because they already know everything. <grin>”

Alex James continues his posts about Composable Services for EF v2 with The problem with Function Signatures of 1/17/2009, which introduces the issue of different representations of the same object, as analyzed by Stefan Tilkov in his link and self post of 1/16/2009 about the Atom Syndication Format’s use of the “self” relation. Stefan cites the ambiguity of using “self”:

[T]o refer to a canonical resource, i.e. the one that represents the object or entity itself in the default way. …

This has the downside that retrieving the resource identified by the outermost self link would yield something different than what you’re looking at. Whether this is acceptable or not depends on whether you consider these two resources to be “identical”. I’m undecided whether the official definition of the self link relation allows for this usage.

But in conclusion, I stand by my opinion that URIs can and should be used for identity – whatever “identity” might mean for you.

Alex concludes:

This is why things like hyperdata / and lazy-loading is so important.

A signature alone is not enough to help me call functions.

Particularly when the target function is called from somewhere with different context, data availability, and trustworthiness.

Hmm… lots of questions

PS: starting to solve this problem seems like a pre-requiste of truly Composable Services.

It seems to me to be an issue for ADO.NET Data Services also.

LINQ to SQL

• Matt Warren’s Building a LINQ IQueryable Provider - Part XIII is the latest (13th) episode in his IQueryable series, which covers:

    • Updates - Insert, Update & Delete operations.
    • Batch processing - true SQL Server batch processing.
    • Server language type systems - correct parameter types.
    • Mapping Changes - use the same class with multiple tables, etc.

Be prepared: The post is several feet long and contains a substantial amount of source code. Complete source code for Matt’s project to date is available at http://www.codeplex.com/IQToolkit.

• Damien Guard writes Multiple outputs from T4 made easy on 1/22/2009 to explain how his updated T4 templates can split the output into a single entity class per file.

Jim Wooley’s LINQ supported data types and functions post of 1/21/2009 relates:

I happened upon a listing on MSDN showing the functions and methods which are and are not supported. The full list of LINQ to SQL supported and unsupported members is available online at http://msdn.microsoft.com/en-us/library/bb386970.aspx.

As an example the following methods are shown as having translations for DateTime values: Add, Equals, CompareTo, Date, Day, Month, Year. In contrast methods like ToShortDateString, IsLeapYear, ToUniversalTime are not supported.

David Klein’s Why the Oakton Microsoft Application Framework (OMAF) Will Not Be Moving to The Entity Framework (EF) 1.0 or any 3rd Party ORM Products Right Now post of 1/20/2009 explains why OMAF will stick with LINQ to SQL until the ADO.NET team releases EF v2. (Copied from the “Entity Framework and Entity Data Model (EF/EDM)” section.)

Damien Guard announces that his LINQ to SQL templates [are] updated, now on CodePlex on 1/19/2009. The latest updates include:

  • Now licensed under the Microsoft Public License and hosted at CodePlex
  • User options specified with a var options block at the start of the template
  • Option for each class to be a separate file that is reflected in the VS project (EntityPerFile=true)
  • Detection and support of IsComposable functions
  • General code clean-up and better error handling such as missing DBML file

You can download a 05:00 screencast that shows how to use the templates here.

See Kristofer Andersson’s Tools - Part 9 - Add-ins - Filtering intellisense dropdowns on required vs optional members post that’s described in the “Entity Framework and Entity Data Model (EF/EDM)” section.

John Opincar recommends in his Expressions versus Delegates in LINQ to SQL Performance post of 1/18/2009:

Favor Expressions over Delegates when using LINQ. If you have to have a Delegate, you can always use Compile to turn your Expression into a Delegate as needed. But you can’t turn a Delegate into an Expression (that I’m aware of).

LINQ to Objects, LINQ to XML, et al.

•• Daniel Moth’s PLINQ post of 1/25/2009 demonstrates code to use “PLINQ as a black box” and create a simple demo example.

•• Jon Skeet starts a project to add LINQ operators that he believes are missing in LINQ to Objects with his Designing LINQ operators post of 1/23/2009.

• Barry Dahlberg’s LINQ to NHibernate, IEnumerable vs IQueryable post of 1/21/2009 and Virtual Methods vs Extension Methods post of 1/23/2009 discuss his initial tests of the LINQ to NHibernate alpha in conjunction with Ayende’s new NHibernate Profiler.

Alex James’ LINQ to Objects and Buffer<T> post of 1/20/2009 analyzes the OrderBy() extension method’s implementation of Buffer<T>, and concludes:

[I]f the Buffer<T> class encounters an ICollection<T> it has a little optimization, that uses Count and CopyTo(..)to initialize an array with the correct size and take a copy of the data, rather enumerating and re-sizing a target array as needed.

When I thought about this I realized that my little Lazy Loading Collection class would return a Count of 0 until it is enumerated. And because the count was 0, the collection would never actually get enumerated.

So when I used OrderBy() over my collection, I get no results.

His solution to the dilemma is to “trigger… a LazyLoad whenever Count is called”.

Keith Brown creates an aggregating LINQ operator for TimeSpan types in his Linq and TimeSpan post of 1/19/2009.

ADO.NET Data Services (Astoria)

•• Udi Dahan’s Building Super-Scalable Web Systems with REST post of 12/29/2008 suggests “leveraging the Internet” with RESTful caching for a highly scalable custom weather reporting mashup. The techniques Udi describes apply to Astoria’s resource mapping to URIs.

• Beth Massi adds an Office-related member to her ADO.NET Data Services series with the ADO.NET Data Services - Building an Excel Client post of 1/21/2009.

• Beth Massi continues her ADO.NET Data Services series with ADO.NET Data Services - Intercepting Queries and Adding Validation of 1/21/2009.

• Jon Udell’s Unifying HTTP success and failure in .NET discusses the differences in how Python’s httplib and .NET’s HttpWebRequest/HttpWebResponse pair handle some HTTP headers and respond to HTTP status codes.

Beth Massi’s ADO.NET Data Services - Enforcing FK Associations and a Fix for Deleting Entities post of 1/20/2009 describes a problem with disallowing nulls in foreign key fields for associated entities and saving changes to the parent entity and its solution. Beth also observes:

You may have issues deleting entities that are involved in an association (regardless of whether they are enforced or not). This was a bug in ADO.NET Data Services described in KB958484 and is fixed with this update. (This should be flowing along with your regularly scheduled Windows Updates but you may not have gotten it yet so if you're experiencing this issue make sure you install this fix.)  In our example I was forced to detach the category object from the client context before submitting the deletes.

ASP.NET Dynamic Data (DD)

•• Steve Naughton’s Setting the Initial Sort Order – Dynamic Data post of 1/23/2009 supplements the post below.

• Steve Naughton makes up for an earlier posting hiatus with his Getting Default Values from List page Filters for Insert – Dynamic Data tutorial of 1/23/2009.

Steve Naughton’s Writing Attributes and Extension Methods for Dynamic Data of 1/20/2009 is “a short article on some useful tips I’ve found for writing Attributes for Dynamic Data.”

Scott Hanselman warns that the ASP.NET team’s “ASP.NET Dynamic Data 4.0 Preview 2 that was quietly put up just a month ago with this scary disclaimer:

NOTE: These previews contains features that may not be in the next version of the framework. These previews are not production quality and should be used at your own risk.

but then goes on to analyze Preview 2 in his lengthy ASP Dynamic Data Preview - More ways to exploit ADO.NET Data Services for fun and profit post of 1/19/2008.

Steve Naughton’s Dynamic Data – Cascading FieldTemplates post of 1/19/2009 discusses how to handle pairs of dropdown lists in which one list filters the source of the other list. For example, a selection in a Category dropdown changes the list of a paired (dependent)Products dropdown.

The solution is more complex that you’d think.

SQL Data Services (SDS) and Cloud Computing

This topic moved on 1/3/2009 to Azure and Cloud Computing Posts for 1/5/2009+.

SQL Server Compact (SSCE) 3.5 and Sync Services

This topic was dropped as of 1/3/2009.

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

No significant posts in the Miscellaneous category were found as of 1/21/2009 11:30 AM PST.

Friday, September 12, 2008

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

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

•••• Updated 9/14/2008 7:00 AM PDT: Addition of EF POCO v 1.02
••• Updated 9/12/2008 9:00 AM PDT: Additions to EF, LINQ, Astoria, SSDS, and Sync Services  
•• Updated 9/11/2008 2:00 PM PDT: Additions to EF, LINQ to SQL, LINQ (to NHibernate and XML), Misc. (Technorati, MVC) 
• Updated 9/10/2008 10:00 AM PDT: Additions to LINQ to SQL, Astoria, Dynamic Data, and SQL Server Compact

Note: All DevDays 2008 session links point to the MSDN Spotlight page because login with a Windows Live ID is required and links without a session ID fail.

Entity Framework and Entity Data Model (EF/EDM)

•••• Jarek Kowalski has updated his Persistence Ignorance (POCO) Adapter for Entity Framework V1 (see below) to v1.02 to fix three issues reported by users that his EF POCO Adapter updated (v1.02) post of 9/13/2008 describes. Download the updated code here.

••• Elisa Flasko’s PDC 2008 - Los Angeles, CA - Oct. 27-30 post of 9/12/2008 to the ADO.NET Team blog describes Tim Mallalieu’s Entity Framework Futures session at PDC 2008:

The next version of the Entity Framework adds scenarios in the areas of   model driven development, domain driven development, simplicity, and integration. See a preview of production and prototype code for the next version of the Entity Framework as well as a candid discussion with members of the development team.

In the meantime, EF V1 pilgrims are still awaiting the arrival of the promised minutes of the first EF Advisory Council meeting.

•• Alex James provides a detailed description of the plans for adding a domain-design-first feature to Entity Framework v2 in his Model First post of 9/10/2008. Topics include:

  • Generating Databases from Models (an overview of the process and UI)
  • Under the Hood (a description of the Sequential Workflow WF implementation)
  • Stage and Purpose (of each WF element)
  • Templates (the T4 templates that perform CSDL to SSDL, CSDL to MSL, and SSDL to DBSchema transformations)

Huageti Systems’ Kristofer Andersson notes in his Tools - Part 5 - Add-ins - Documentation features in Entity Framework vs Linq-to-SQL post of 9/2/2008:

[EF’s documentation feature] has a cosmetic flaw: In the haste to release VS2008 and .net 3.5 SP1 it seems like MSFT forgot to apply the entity type documentation to the entity set accessor properties, so entity sets (and all undocumented classes and properties) will show the default “There are no comments for [name] in the schema.“. I would like to see the EntitySet using the same documentation as the EntityType, or at least have a “Documentation” property of its own. (It does in the EDMX, but not in the designer)

The “There are no comments” default value is a bit redundant and waste of screen real-estate. Why not leave the default value blank? Oh well, this is just version one so I guess that will be improved in some future service pack update.

Also missing is the ability to automatically populate the documentation field with descriptions from data model diagrams and/or the database. The descriptions may already exist in a data model diagram or in the database. In addition, knowing what indexes exist is very useful when writing queries, and what indexes exist on tables etc are of course available from the database so being able to automatically retrieve those two pieces of information from the db would be a nice-to-have feature.

According to Alex, EF v2 will include metadata for indexes because the generated DDL add them.

Note that Damien Guard has produced an initial set of T4 templates for serializing LINQ to SQL classes, as described in my Bidirectional Serialization of LINQ to SQL Object Graphs with Damien Guard’s T4 Template in VS 2008 SP1 of 7/27/2004. A later version will add:

  • Inheritance support
  • VB.NET generation
  • DataContract serialization

But it won’t support stored procedures or composite primary keys.

Jarek Kowalski’s Persistence Ignorance (POCO) Adapter for Entity Framework V1 post of 9/9/2008 provides extensive details about the new EFPocoAdapter that’s available for download from the CodeGallery. Here’s its description:

EF POCO Adapter enables Plain Old CLR Objects (POCOs) to be tracked using released version of Entity Framework V1. It consist of a code generator, supporting library and a test suite and examples.

Code generator writes an adapter layer that will translate between POCO objects and Entity Framework-aware objects and provide services on top of POCO objects, such as:

  • Change tracking (snapshot-based and proxy-based when possible)
  • Transparent lazy loading
  • Immutable Value Objects
  • Queries (LINQ and Entity SQL)
  • Shadow state (maintaining certain persistence-related fields outside of entity class)

Entity Framework V1 programming interfaces are wrapped with corresponding APIs that work with POCO objects and do necessary translation between POCO and Persistence-Aware objects.

The availability of the new adapter should quiet the tumult and shouting about EF’s lack of persistence ignorance.

• Update 9/10/2008: From comments to Jarek’s post:

Roger Jennings (9/9/2008):

Does Astoria consider the POCO Adapter's EFPocoContext a first-class data source, that is, supports IQueryable<T> and induces the Astoria runtime to provide IUpdatable<T>?

In other words, can it be plugged into an Astoria project without adding a significant amount of code?

Jarek Kowalski (9/9/2008):

I'll investigate the Astoria question, but since EFPocoAdapter does not implement IUpdatable I don't think it works now. …

OK. I have played with Astoria and I was able to get a basic service to work. All you have to do is to derive from DataService<adapterContextType>, such as:

public class NorthwindEFService : DataService<NorthwindEntitiesAdapter>
{
}

This makes use of the "second face" of the object model, which is the EF-compatible adapter layer. Astoria doesn't have a clue that it is talking to POCO model, but the EF-POCO translation happens under the hood.

Implementation of IUpdatable should be pretty straightforward, though.

Mike Taulty presents Understanding the ADO.NET Entity Framework at DevDays 2008 Amsterdam (Video, May 2008).

LINQ to SQL

•• Mike Tulty’s Messing with Dynamic LINQ Queries post of 9/11/2008 shows his attempt with a LINQ to SQL query:

[T]o take the Expression which will have 2 parameters and reduce it down to an Expression which has 1 parameter by hard-wiring the 2nd parameter with the current value of the loop variable "s" into the method call expression itself as a constant.”

•• Mike Hadlow has posted a working sample and source code for the Suteki Shop eCommerce application that uses the following technologies:

  • .NET 3.5
  • MVC Framework
  • LINQ to SQL
  • Windsor IoC Container
  • NUnit (for testing)
  • Moq (for mocking)

• Matt Manela explains in his SQL CE 3.5 with LINQ to SQL post of 9/9/2008 how to avoid the performance hit caused by moving SQL Server Compact (SSCE) 3.5 into and out of memory when LINQ to SQL opens and closes connections on single or multiple threads.

Bill Burrows’ ASP .NET MVC Framework - Preview 4 Update demonstration “highlights the changes in the MVC model since the release of Preview 1 and covers both "drill-down" applications as well as showing how to update and existing database record and add a new record” with VS 2008 (not SP1), LINQ to SQL and VB.

It’s unfortunate that the demo is one service pack and preview behind, but most of the two video links apply to current releases.

Bill also offers a VB-based LINQ to SQL Tutorial and Introduction to MVC Tutorial.

Anko Duizer presents Is LINQ to SQL your data Access Layer? from DevDays 2008 Amsterdam (Video, May 2008).

LINQ to Objects, LINQ to XML, et al.

••• Eric White describes how LINQ used C# 3.0’s closures feature in his Closures post of 9/12/2008.

•• Ayende Rahien‘s NHibernate 2.0 and Linq post of 9/11/2008 delivers formal notification that LINQ to NHibernate is not part of the recently-released NHibernate 2.0, but an improved LINQ implementation will be part of NHibernate 2.1.

However, he notes that “Daniel Guenter has back ported the current version of Linq to NHibernate to Nhibernate 2.0 and made it available here.”

Mike Hadlow noted problems with LINQ to NHibernate and complex queries in his What's up with Linq to NHibernate? post of 9/2/2008.

•• Shayne Burgess notes that the XML Team plans to incrementally publish “frequently encountered issues in System.XML; mainly points that we felt were interesting because they were the source of a lot of difficulty for our users.” The first two members of the Frequently Asked Questions on XML in .NET series are:

  1. Part 1: Invalid Literals (9/10/2008)
  2. Part 2: Conformance Level – Fragment (9/10/2008)

While not specifically about LINQ to XML issues, they should be of interest to developers using LINQ to XML.

John Papa describes a workaround for an Amazon Web Services’ book price ambiguity in his LINQ to XML Tip - Checking for Values post of 9/9/2008.

Eric White explains “how to use content controls in Open XML word documents to delineate code snippets so that you can automate validation of the snippets” in his OpenXmlCodeTester: Validating Code in Open XML Documents post of 9/8/2008. Eric says:

I suspect that this blog post will be very interesting to a very few people, but of casual note to all others. I’m very interested to hear if this scenario is useful to you. But more than this particular scenario, I want to spark interest in the possibilities that content controls open up for you.

This may be the longest blog post I’ve written, because this blog post also serves as a manual of sorts for OpenXmlCodeTester.

Eric’s code is based on functional programming principles and all variable values are immutable.

Sessions from DevDays 2008 Amsterdam (Video, May 2008):

ADO.NET Data Services (Astoria)

••• Elisa Flasko’s PDC 2008 - Los Angeles, CA - Oct. 27-30 post of 9/12/2008 to the ADO.NET Team blog describes the following two Astoria presentations at PDC 2008:

Developing Applications Using Data Services: Mike Flasko

In the near future, applications will be developed using a combination of custom application code and online building block services, including data-centric services. In this session we discuss advancements in the Microsoft development platform and online service interfaces to enable seamless interaction with data services both on-premises (e.g., ADO.NET Data Services Framework over on-premises SQL Server) and in the cloud (e.g., SQL Server Data Services). Learn how you can leverage existing know-how related to LINQ (Language Integrated Query), data access APIs, data-binding, and more when building applications using online data.

Offline-Enabled Data Services and Desktop Applications: Pablo Castro

The ADO.NET Data Services Framework (a.k.a. Project "Astoria") introduced a way of creating and consuming flexible, data-centric REST services. By combining data services with the Microsoft Sync Framework, learn how to create offline-capable applications that have a local replica of their data, how to synchronize that replica with an online data service when a network connection becomes available, and how replicas can be used with the ADO.NET Entity Framework. Also, hear us talk about our plans, see the tools that help client- and server-side setup, and discuss the runtime components and APIs.

• Mike Flasko’s ADO.NET Data Services Concepts post of 9/9/2008 points to a new "Overview of ADO.NET Data Services" white paper on MSDN. Mike says:

The document is meant to cover the high-level concepts for the product.  A companion paper "Using ADO.NET Data Services" published a little while ago complements this overview with details on product features and how to use them. 

Coming up next is a paper which goes one level deeper and shows how to host data services in different environments (ASP.NET, WCF, IIS, WCF self host, etc).

Click here for more information from LINQ and Entity Framework Posts for 9/2/2008+ about the companion paper.

Sessions from DevDays 2008 Amsterdam (Video, May 2008):

ASP.NET Dynamic Data (DD)

•• Mike Ormond’s Dynamic Data and Entity Framework post of 9/11/2008 describes exceptions thrown when using EF with Northwind as the data source: one with the Order_Details entity and one when navigating the Product –> Order_Details relations (that composite index issue again!) The fix is the Dynamic Data Entity Framework Workaround on CodePlex.

• Steve Naughton completes his Dynamic Data Futures series with his Dynamic Data Futures – Part 3 – AnyColumnAutocomplete Filter post of 9/9/2008. Steve says:

The issue is that the Autocomplete filter and AutocompleteFilter web service is designed to work with Foreign Key columns, I thought this would be like the previous article in this series and be quite simple, instead it turned out to be a bit more complicated

SQL Server Data Services (SSDS)

••• Eugenio Pace lauds Apprenda’s SaaSGrid cloud services framework for ISVs in his Northwind Hosting exists, it's better than what you saw and it's called SaaSGrid post of 9/12/2008. Eugenio says:

This "non-intrusiveness" of SaaSGrid is a property of PaaS offerings we have studied in the past. I personally believe that all offerings requiring an ISV to re-write an app, or re-learn a whole new development paradigm (custom language, non-mainstream storage, etc) will be at a disadvantage compared to PaaS offerings that will make the most of your existing investments and strengths, and therefore adoption will be hurt (probability +80% :-)).

Eugenio’s Northwind Hosting concept demo and related white papers form much of the foundation of SSDS and especially the LitwareHR demo. Watch the video to learn more about SSDS’s current and future architecture and features.

Mike Amundsen updated his “SSDS-Proxy and SSDS Provision Client code on 9/8/2008 to support returning the Authority List for the logged-in user. This update also includes support for reading and deleting BLOB files (no upload via the web - yet).”

A live demonstration is running here http://amundsen.com/ssds/. The source code is available from Codeplex http://codeplex.com/ssdsexamples/.

SQL Server Compact (SSCE) 3.5 and Sync Services

••• See Offline-Enabled Data Services and Desktop Applications: Pablo Castro

• Matt Manela explains in his SQL CE 3.5 with LINQ to SQL post of 9/9/2008 how to avoid the performance hit caused by moving SQL Server Compact (SSCE) 3.5 into and out of memory when LINQ to SQL opens and closes connections on single or multiple threads. (Also in LINQ to SQL category.)

Martijn Beenes presents Sync Framework from DevDays 2008 Amsterdam (Video, May 2008).

Visual Studio 2008 Service Pack 1 (General)

Beth Massi’s What's New in Visual Studio 2008 SP1 - Client and Data Features post of 9/11/2008 includes links to the slides and code from her presentation to the East Bay.NET UG on some of the new features in Visual Studio Service Pack 1, including:

  • SQL 2008 Types and Data Binding Support
  • ADO.NET Sync Services Enhancements
  • WPF Enhancements
  • ADO.NET Entity Framework Designer
  • ADO.NET Data Services (Astoria)
  • “Client Profile” Framework Deployment
  • VSTO Content Controls and Smart Tags
  • VSTO Deployment Improvements

I wonder how long the meeting lasted.

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

••• (OT) Roger Jennings takes Technorati to task for making acquisitions while failing to maintain their primary obligation to the blogosphere and provide timely customer service in his More Technorati Troubles post of 9/11/2008.

These two posts re Technorati were added on 9/12/2008:

Update 9/11/2008 2:30 PM PDT. Apparently the above post caught Technorati’s attention. The latest posts are now appearing and the Authority was updated (-2 points.)

•• David Hayden’s ASP.NET MVC and Enterprise Library Validation Application Block post of 9/10/2008 complements his earlier post with instructions for integrating the Validation Application Block with ASP.NET MVC.

Scott Heuer says in his 9/9/2008 post, H.264 and AAC support coming to Silverlight (in a future version). The Silverlight Shines at International Broadcasting Conference 2008 in Amsterdam press release of the same date includes Q&A with Scott Guthrie about the new video codecs for Silverlight.

Mike Taulty’s Silverlight, Async, Events post of 9/8/2008 deals with issues around asynchronous operations and the inability to pass an event into a function.

David Hayden uses a simple Customer class in his Custom Model Binder and More UI Validation in ASP.NET MVC post of 9/8/2008 to demonstrate the CustomModel binder’s input validation capabilities.

David Hayden’s ASP.NET MVC UI Error Handling - ModelState and AddModelError post of 9/7/2008 demonstrates validating a phone number input with ModelView’s ModelState property and the ModelState.AddModelError() method.

Miscellaneous Sessions from DevDays 2008 Amsterdam (Video, May 2008):

Monday, August 25, 2008

LINQ and Entity Framework Posts for 8/20/2008+

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

••• Updated 8/25/2008

•• Updated 8/24/2008

• Updated 8/22/2008

Entity Framework (EF)

•• The Domain.Net Team’s NHibernate 2.0 gold Released – Must Wait for ‘Linq to NHibernate’ post of 8/24/2008 notes that NHibername 2.0 release yesterday without incorporating LINQ to NHibernate. You must download the implementation from a new location, http://sourceforge.net/projects/nhcontrib.

••• Fabio Maulo’s 21 chapters of NHibernate documentation as a Google Knol offers open contribution under a .

•• Muhammad Mosa discovers EF’s LINQ to Entities doesn’t support many constructs that LINQ to SQL handles with no problem. His LINQ to Entities, what is not supported? post of 8/24/2008 describes the following problems when migrating the data source of Rob Conery’s sample MVC Storefront project from LINQ to SQL to Entity Framework:

    • Custom Methods & Extension Methods cannot be translated into a store expression
    • LINQ to Entities only support Parameterless constructors and Initializers
    • IEnumrable types cannot be initialized in LINQ to Entities query

You can download Moses’s project from a link on his post.

•• Matthieu Mezil finds that the orderby … descending expression produces unexpected results in his LINQ To Entities: Strange, very strange post of 8/23/2008.

•• Matthieu Mezil’s TPH limitation which should disappear with v2 post of 8/23/2008 describes an exception when using Is Null and IsNot Null conditions on a table-per-hierarchy inheritence model (see below) that shouldn’t happen and needs fixing in EF v2.

• Matthieu Mezil discusses the use of NULL values in the type discriminator column of a table-per-hierarchy inheritance model in his TPH is more than a selection! post of 8/22/2008.

• Mikael Henriksson waxes enthusiastic about EF in Entity Framework - The best thing since the wheel? of 8/22/2008. He’s using EF in a real-world project and says:

Entity Framework can't replace working within a well thought through Domain Model but it sure helps me in my everyday work. I just finished a drafting a part of our application that took month and a half to get up and running the first time (I was not involved in the first version). It took me 2 days to come up with a pretty much solid version 2 of that same part.

Mikael claims using EF reduced the 60 developer*day project to 4 developer*days (including 2 days for adding business validation rules)

• Ido Flatow shows you how to change CSDL and MSL files programmatically in his Change Entity Framework storage DB schema in runtime of 2/22/2008. Changing files at runtime enables working with experimental, developmental, and production databases without the need to change and recompile your EF code.

• Matthieu Mezil explains in How to have a property on ObjectContext which returns the derived entities? of 8/21/2008 how to customize the code generator to add a property for the EntitySet of an inherited property in two passes. However, this later version does the same job in a single pass.

David Yack finds that adding a type declaration for the from clause’s parameter in a LINQ to Entities expression adds a Cast<T> operator to the translated expression in his Entity Framework - Cast Affects Include post of 8/21/2008. The spurious Cast<T> operator caused his Include() method to fail. Removing the type declaration solves the problem.

ADO.NET Data Services (Astoria)

•• Dare Obasanjo’s RESTful JSON: Bringing REST and RPC Closer Together post of 8/24/2008 analyzes comments by Dave Winer and Tim Bray about Dare’s earlier Explaining REST To Damien Katz essay. Dare concludes:

If you put together the notion of service documents with using JSON as the payload format for a service endpoint, you're close to getting the touted programmer friendliness of RPC technologies like XML-RPC & SOAP/WSDL while still building a RESTful service which works with the Web instead of against it.

The only problem is how to deal with statically typed languages like C# and Java. These languages need the types of the objects that application will consume from a Web service defined up front. So if we could just figure out how to come up with service documents for JSON services that included the notion of a class definition, we could pretty much have our cake and eat it to with regards to getting the ease of use of an RPC system while building a RESTful service.

Sounds to me like an interesting development that might apply to Astoria v2 and SSDS.

• Marcelo Lopez Ruiz adds another reason why you’ll probably want to use ES as Astoria’s O/RM data source, despite the performance hit when you first spin it up with a large number of objects. His EntityState problems in ADO.NET Data Service post of 8/22/2008 reports:

[I]f you are using a 'T' that's not the ObjectContext-derived type in your DataService<T>, the service won't know you're using an ADO.NET Entity Framework types, and will try to discover types and properties by following references, which eventually leads to the EntityState property problem. Using the ObjectContext type as the 'T' should then solve the problem.

• Marcelo Lopez Ruiz demonstrates why the Entity Data Model is Astoria’s default data source in Metadata for ADO.NET Data Services of 8/21/2008: The $metadata resource returns a description of the data model in EDM’s Conceptual Schema Definition Language (CSDL).

Pablo Castro offers a summary history of ADO.NET Data Services in his Timeline of Project Astoria of 8/20/2008 categorized as: Idea, Hack, Pitch, Prototype, Review, Announcement, Team, Design, Release, Future. Makes interesting reading.

Alex Barnett recalls three of his Astoria experiences in How ADO.NET Data Services came to be (formerly known as Project Astoria) of 8/20/2008.

Marcelo Lopez Ruiz explains the DataServiceContext.UsePostTunneling property in POST tunneling in ADO.NET Data Services of 8/20/2008.

Scott Hanselman’s The Weekly Source Code 32- Atom, AtomPub and BlogSvc, an AtomPub Server in WCF post of 8/20/2008 provides more insight into in System.ServiceModel.Syndication and ServiceDocument in the context of the new open-source BlogSvc implementation of AtomPub that’s compatible with Windows Live Writer.

Gil Fink comments on Arnon Rotem-Gal-Oz’s Why the Database as a
Service is a Bad Idea
post in Why Data as a Service isn't a Bad Idea of 8/20/2008 and concludes:

So what is the potential of ADO.NET Data Services?
In a RIA … or data driven application it can help to provide a cleaner solution. The ability of Data Services to return responses in JSON or in URI makes them flexible and usable by Ajax or Silverlight. Also, if the data service is consumed by a .Net client you can use the LINQ to [REST] feature. The Data Services come with other features like concurrency, batch operations over HTTP, full query operation support and more. These features, when used right, can help to provide good solutions for a data driven application.

SQL Server Data Services (SSDS)

•• Mike Amundsen is Looking for Suggestions on Implementing One-to-Many, Many-to-Many Patterns in SSDS, according to his 8/22/2008 thread in the SQL Server Data Services (SSDS) - Getting Started forum. Hopefully, an SSDS team member will provide insight how the service will emulate joins on the client efficiently. (As I read the tea leaves, there are no plans for the service to implement joins.)

Stephen Wynkoop Challenges with Data Management in the Cloud? article from the SQL Server Worldwide Users Group (SSWUG.org) newsletter of 8/21/2008 suggests that data stored in cloud databases …

can be accessed by serving appropriate warrants or other legal processes to the cloud provider.  In some cases, this can be done without notifying the owner of the information (such as cases where they think that by knowing, the owner could/would/might destroy information). …

Perhaps we need a system where the information stored in the cloud is done so encrypted, with keys that are owned by the information owner only.  That way the cloud provider returns to being just that, a service provider, without having responsibility (or access) for/to the data on their systems.

I believe that this is a topic that the SSDS Team should consider for implementation in v1 RTM but probably requires SQL Server 2008. (The present “CloudDB” runs on modified SQL Server 2005.)

ASP.NET Dynamic Data (DD)

••• Matt Berseth drills down on the use of DD’s MetadataType attribute in his Dynamic Data and Custom Metadata Providers post of 8/24/2008.

• Scott Hunter’s Image Generation is released to CodePlex post of 8/21/2008 describes the long-awaited ASP.NET GeneratedImage replacement for Whidbey’s (!) DynamicImage feature that got cut from VS 2005. GeneratedImage is an ASP.NET control that automatically generates an ImageHandler and wires the control to its URL. The new control is ideal for use in DD projects.

ImageHandler is an implementation of IHttpHandler that, according to Scott, supports:

  • Transforms (resizing, watermarks, user defined transforms)
  • Client-side caching
  • Server side caching
  • Access to parameters passed from the GeneratedImage control
  • Provide simple mechanics for returning images

• Scott Hanselman’s ASP.NET Futures - Generating Dynamic Images with HttpHandlers gets Easier post of 8/21/2008 provides examples of creating and using the GeneratedImage control.

• Matt Berseth offered yet another ASP.NET Dynamic Data - Simple 5 Table Northwind Example on 8/21/2008. He says:

I am pretty impressed and I am looking forward to exploring this further - stay tuned.

Matt Berseth being “pretty impressed” with DD bodes well for its future.

Josh Heyse uploaded Dynamic Data Filtering v1.01, which eliminates private reflection, to CodePlex on 8/20/2008. Josh says he “worked with the Dynamic Data team to open up several internal method calls to eliminate the need for the reflection.”

You can learn more about Dynamic Data Filtering, which adds:

  • Searching ranges (ListPrice > 10 AND ListPrice < 500)
  • Searching in a list of possible values (Class in (‘L’, ‘M’))
  • Partial text searching (Color LIKE ‘B%’)

to the stock DD filters, from the five-part A Richer DynamicFilterRepeater series on Josh’s blog.

Justin Etheredge’s Exploring System.Web.Routing post of 8/20/2008 is a detailed tutorial on the new URL mapping feature introduced by VS 2008 SP1 for ASP.NET MVC and DD.

LINQ to SQL

••• David DeWinter requests potential users to suggest features for his LINQ to SQL utility that supports updating the object model from the database schema and property-name fixup in his DBML Fixup Preview post of 8/24/2008. David’s current feature list appears to duplicate the LINQ to SQL capabilties of Kris Andersson’s Huagati DBML/EDMX Tools. David has scheduled DBML Fixup for a year-end release.

•• Andrew Davey suggests a set of rules for creating “convention-based mapping” with LINQ to SQL’s XML mapping files to minimize manual authoring in his LINQ-to-SQL Convention Mapping Source post of 8/24/2008

• Beth Massi’s Data on the Smart Client Talk at Bay.NET UG post of 8/21/2008 provides a link to her databinding to WinForms and WPF clients presentation to the Bay.NET user group and its sample code. (The OMS.mdf database file required for the demos is in the …\LINQSQLDemo\OMSDataLayer folder.)

Jim Wooley delves into Object Identity tracking changes with LINQ to SQL SP1 on 8/21/2008 and explains that LINQ to SQL checks the cache before sending a T-SQL query to retrieve a single entity instance.

Simon Segal offers props to LINQ to SQL in The future of LINQ To SQL and showing some support of July 30, 2008 and the bumper sticker below to proclaim solidarity with the first and fastest LINQ O/RM implementation:

which links to Ian Cooper’s Showing some support for LINQ to SQL post of July 2, 2008. Ian says, in part:

I would like to see MS give this product the support it deserves. I would like to see a commitment from the Data Platform team to stop its focus on talking LINQ to SQL down as a RAD tool and tallking up its advantages for use in the OO approaches to software development. For example  I would like to see the Data Platform team talking about LINQ to SQL's support for POCO strategies, lazy loading, etc. and pointing out to customers who request those features. There needs to be more acknowledgement that if you want them you should consider LINQ to SQL.

[I missed these items when originally posted.]

LINQ to Objects, XML, et al.

••• Jim Wooley shows you how to Enable the Expression Tree Visualizer in VS 2008 in his 8/24/2008 post.

•• Damon Wilder Carr’s LINQ to Financial Markets : Optimizing Provider to Real-Time Quotes, Analytics, and Silverlight-WPF Visualization post of 8/22/2008 describes a forthcoming LINQ implementation that offers:

An easier way to consume, visualize, understand and quantify just about any information you can imagine from the world of global financial services.

  • Real-Time stock quotes to Complex Analytics of Multi-Asset Class Portfolios
  • Monte-Carlo simulation with Optional Quantitative Add-Ins
  • Efficient frontier Optimization based on Constraints you Set
  • User defined heuristics from strategic rebalancing to day-trading

Release of the new provider currently is in limbo. Damon says:

Due to the nature of the access to this information, we are still working out the details for the open-source version we plan to offer soon. The world of the owners of this data has not caught up to the philosophy we have for transparency and shared value.

•• Jim Wooley says “LINQ to Reflection isn't really a provider, but just a specific implementation of LINQ to Objects which happens to query reflection information” in his LINQ to Reflection IsNot LinqProvider post of 8/23/2008.

• Eric White’s Using LINQ to XML to Retrieve Content Controls in Word 2007 post of 8/21/2008 shows you how to write a LINQ query to retrieve the contents of Word 2007’s content controls.

Bart De Smet gets the Longest Post Title Award for What Do VB 9.0 Error “BC36593: Expression of type ‘X’ is not queryable.” And C# 3.0 Error “CS1936: Could not find an implementation of the query pattern for source type ‘X’.” Really Mean? of 8/20/2008. His essay explains in granular detail what these VB (!) and C# error messages mean.

Mike Ormond discovers in his LINQ to JSON post of 8/21/2008 that LINQ to JSON from Silverlight’s System.Json namespace saves a lot of code because he doesn’t need to define a .NET type to represent the JSON object.

SQL Server Compact (SSCE) 3.5 and Sync Services

No SSCE posts as of 11:00 PDT. 

Visual Studio 2008 Service Pack 1 (General)

•• Scott Hanselman’s SmallestDotNet: On the Size of the .NET Framework post of 8/23/2008 describes options for upgrading client PCs to .NET Framework 3.5 with installers that range in size from 10 MB to 56 MB, depending on the client’s current versions. Scott also describes the Client Profile:

The Client Profile is an even smaller install option for .NET 3.5 SP1 on XP. It's small 277k bootstrapper. When it's run on a Windows XP SP2 machines with no .NET Framework installed, it will download a 28 meg payload and give you a client-specific subset of .NET 3.5.  If the Client Profile bootstrapper is run on a machine with any version of .NET on it, it'll act the same as the 3.5 SP1 web installer and detect what it needs to download, then go get it.  There's more details in the Client Profile Deployment Guide.

Scott also announces his new SmallestDotNet page that executes a small chunk of JavaScript to inspect your browser’s UserAgent and determine what version of the .NET Fx is installed. The script reports the total size of the download to update to .NET Fx 3.5.

Microsoft Downloads offers the Visual Studio 2008 SDK 1.1 as of 8/20/2008:

The Visual Studio 2008 Software Development Kit (SDK) 1.1 includes tools, documentation, and samples for developers to design, build, test and deploy extensions for Visual Studio 2008 Service Pack 1. You can also use the Visual Studio 2008 SDK 1.1 to create custom tools environments based on the Visual Studio 2008 Service Pack 1 Shell.

Miscellaneous (WPF, WCF, Silverlight, etc.)

The SQL Server Worldwide User Group (SSWUG.org) will present a .NET Virtual Conference on October 28-30, 2008. Presenters include .NET and EF luminaries such as Kathleen Dollard, Ben Hoelting, Tim Huckaby, Tim Huer, and David Yack.

Dare Obasanjo’s Some Thoughts on Amazon's Elastic Block Store essay of 8/21/2008 about Amazon’s new EBS service, which provides 1 GB to 1 TB blocks of persistent storage that you can format as a file system, concludes:

EBS is the final piece in the puzzle that had prevented Amazon's cloud computing platform from being comparable to traditional hosting solutions. With EBS Amazon is now superior to most traditional hosting solutions from a developer usability perspective as well as cost. Google App Engine now looks like a plaything in comparison. In fact, you could build GAE on top of Amazon's cloud computing platform now that the EBS has solved persistent custom storage problem.

Werner Vogels, Amazon’s CTO, announced that Amazon EBS - Elastic Block Store has launched on 8/20/2008. His post contains additional details about EBS. Vogels announced plans to create EBS in his Persistent Storage for Amazon EC2 post of 4/13/2008.

Thursday, July 24, 2008

LINQ and Entity Framework Posts for 7/21/2008+

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

Updated 7/23/2008: Additions

Eric White Asks: Are Developers Using LINQ?

Erick wants to know:

  1. Do developers at your company understand and use LINQ?
  2. Do you?
  3. Can you see the benefit?

Leave the answers as a comment to his Are Developers Using LINQ? post of July 24, 2008.

Added: 7/23/2008

Pat Helland Returns to the SQL Server Team from Developer Division

Pat Helland, the champion of autonomous applications, announced his return to the SQL Server Group in his “Transferring to the SQL Team” post of July 23, 2008. He’s back after a hiatus at Amazon.com and a stint with Scott Guthrie and friends at the developer division.

If you missed Pat’s famous “Autonomous Computing: Fiefdoms and Emissaries” presentation at Tech*Ed 2002, you can peruse the PowerPoints here.

Pat says:

Now, it turns out there is a really special opportunity for me to join a team in SQL called SIA (Strategy, Infrastructure, and Architecture).  This spot allows me to work on the business, technology, architecture, infrastructure, and more for one of the industry's leading products.  It also allows me to participate in driving some of the new changes in scalable cloud computing (which is, of course, where I am extremely passionate). [Emphasis added.]

I think it’s safe to assume that “scalable cloud computing” = SQL Server Data Services (SSDS).

P.S. You might enjoy reading Pat’s A Weekend at Foo Camp post of July 16, 2008 about his stay at this year’s Foo Camp in Sebastopol, CA.

Added: 7/23/2008

Marcelo Lopez Ruiz Warns ADO.NET Data Services Developers About Stack Overflows When Testing Asynchronous Calls

In his Beware of stack overflows in asynchronous calls post of July 23, 2008, Marcelo discusses stack overflow errors when testing APIs of the ADO.NET Data Services client-side DataServiceContext. Marcello suggests:

The fix in my case was to schedule the next piece of work to be done rather than executing it immediately in the callback. Whenever you're doing these sorts of things, SynchronizationContext is your friend, which in Silverlight is implemented in DispatcherSynchronizationContext. The Post method allows you to queue up a piece of work (execute asynchronously).

Added: 7/23/2008

Damien Guard Offers Full-Featured T4 Template to Generate LINQ to SQL Classes

Damien’s Experimental LINQ to SQL template post of June 25, 2008 was an encouraging demo of how a T4 template might be used to customize generated LINQ to SQL class code. However, this early version was missing many features required to use the template for production projects.

His new LINQ to SQL T4 template reloaded post of July 23, 2008 takes the early version to completion with the following features:

  • Runs from the DBML therefore keeping the designer in the loop
  • Generates all the attributes for columns and tables including UpdateCheck, IsDbGenerated, etc.
  • Supports associations including those with a foreign key
  • Generates appropriate attributes and code for both serialization modes

The current version is C# only.

Added: 7/23/2008

Lawrence Jones Shows How the EDM Designer’s Update Model from Database Feature Works

Lawrence’s three-part series about the EDM Designer’s Update Model from Database operation explains “the reason behind some of [its] oddities” and answers some frequently asked questions about the feature:

Steve Naughton Starts ASP.NET Dynamic Data FieldTemplate Tutorial

FieldTemplates are a key feature of ASP.NET Dynamic Data. Following are the links to episodes of Steve’s three-part series about FieldTemplates:

Stephen A. Bolen Teaches NHibernate with a Series of Screencasts

Scott Hanselman extols the virtues of Stephen’s Summer of NHibernate Screencast Series in his Learn How to use NHibernate with the Summer of NHibernate Screencast Series post of July 22, 2008. Six episodes were available as of 7/22/2008.

Scott says:

I used NHibernate as my Data Layer recently when I got ASP.NET MVC running under .NET 2.0 using NHibernate examples from Davy Brion (who has an NHibernate Category on his blog).

NHibernate is very flexible, but it's a little overwhelming (for me, at least) to get started. Davy has a good "code-heavy" walkthrough of the concepts. Some NHibernate write-ups assume too much, IMHO.

Perhaps to combat this, Stephen Bohlen has created the Summer of NHibernate Screencast Series as a learning tool to educate engineers at his company.

Stephen says:

"Often, our strategy for bringing people up to speed on [NHibernate] has been to rely on word-of-mouth and osmosis (often via pair-programming) to get the points across, but now we have a planned staffing ramp-up of a magnitude that will likely make that approach unwieldy."

The screencasts give you deep insight into the complexities of NHibernate and how it differs from LINQ to SQL and the Entity Framework.

Matt Hinze Delivers a Step-by-Step Tutorial for Checking Out and Testing LINQ to NHibernate

Matt’s Linq to NHibernate in 10 minutes post of July 22, 2008 provides the steps you need to test the current release of LINQ to NHibernate from SourceForge’s NHContrib project with Jeffrey Palermo’s sample CodeCampServer project.

Here’s the Tortoise Repository Browser displaying the NHibernate.LINQ source folder:

Note: You must register for a SourceForge account before checking out projects.

Daniel Leiszen Addresses LINQ4SP’s Query Evaluation to CAML Queries

In LINQ4SP Query Evaluation of July 22, 2008, Daniel explains that some LINQ expressions can’t be converted to SharePoint CAML expressions. In this case, the query must be broken into a CAML query that can be executed on the SharePoint server and LINQ expressions executed on the client.

Daniel Crenna Proposes a Pattern for Layering LINQ to SQL and WCF for Silverlight

In the first of a multipart series, LINQ + WCF + Silverlight (Part One) of July 21, 2008, Daniel adds two lightweight classes, AdventureWorksRepository and AdventureWorksUnitOfWork, to those generated by the O/R Designer “to create a functional data layer.”

Gianpaolo Carrera Posts a One-Hour Webcast About SaaS for Enterprise and ISV Architects

Gianpaolo’s Software + Services for Architects Webcast post of July 21, 2008 provides a link to his one-hour SaaS for Architects Webcast with emphasis on Microsoft’s cloud-based services and includes two of its slides.

The first slide (Big Pharma topic) applies to enterprises “wanting to optimize [their] IT environment[s] by leveraging a heathy mix between on-premises, SaaS and cloud” operations.

The second slide targets “an existing ISV (LitwareHR topic) moving from ‘server based infrastructure’ (Win2k8, SQL, AD) to ‘cloud based infrastructure’ (cloud compute, cloud storage, cloud identity [and SSDS].”

Gianpaolo mentioned that Microsoft currently is installing 10,000 servers per month to their cloud.

C. C. Chai Finds a Paging Bug in SQL Server Data Services Async Queries

C.C.’s A bug in paging (SOAP interface)? post of July 21, 2008 in the SQL Server Data Services (SSDS) - Getting Started forum spotted a problem paging asynchronous queries: The first group of results returns 499 instead of 500 entities. The SSDS team was able to duplicate the bug.

Shawn Wildermuth Uncovers Issues When Hooking ADO.NET Data Services to LINQ to NHibernate

In an earlier (July 20, 2008) post, Shawn finds Silverlight 2 + NHibernate.LINQ == Sweet. However, his NHibernate.LINQ with ADO.NET Data Services post of July 21, 2008 runs into Astoria’s “ID” bug, which Microsoft says will be fixed in the RTM version. You also must use a generic IList<T> for one:many associated entities.

Shawn also notes Ayende Rahien’s reservations about “availability and scalability on the operations side, and schema versioning and adaptability on the development side” and cautions prospective users about Astoria’s lack of data security features.

Scott Hunter Summarizes New ASP.NET Dynamic Data Updates

Scott’s Many Updates on Dynamic Data post of July 21, 2008 describes updates to:

Steven Walters ASP.NET MVC Tips Include Data Layer Advice

Steve’s ASP.NET MVC posts include a series of tips for implementing this new technology. The following tips apply to LINQ to SQL:

Proposed New FunctionImports Flexibility in Entity Framework v2

Alex James’ Using Stored Procedures to load structured data post of July 18, 2008 describes plans to:

  • Allow FunctionImports to return unattached/untracked Entities
  • Allow FunctionImports to return ComplexTypes

    in Entity Framework v2. These features would supplement the EntitySet returned by FunctionImports mappings for scenarios where the entity or complex type returned by a stored procedure doesn’t require data tracking and updating.

  • Saturday, July 19, 2008

    LINQ and Entity Framework Posts for 7/16/2008+

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

    Updated 7/20/2008 with additions.

    Shawn Wildermuth Adds ADO.NET Data Services Support for LINQ to NHibernate in a Silverlight 2 Example

    Shawn’s Silverlight 2 + NHibernate.LINQ == Sweet post of July 19, 2008 describes an NHibernate.LINQ (LINQ to NHibernate) implementation for ADO.NET Data Services (Astoria) in a live Silverlight 2 sample project. According to Shawn, the new implementation includes:

    • Support for IUpdateable to support full NHibernate CRUD.
    • Support for a new Expand extension method to do eager loading via the LINQ interface.  (The Expand method is similar to Entity Framework's Include method.)
    • Finally, using the Expand extension method, I implemented the IExpandProvider interface to allow for expansions via the REST API.

    Shawn promises:

    In addition, I'll be finishing up my discussion of implementing the IUpdateable interface pretty soon to help those of you adding this support to your projects. I'll also be blogging about how I added the IExpandProvider to help those of you trying to add that to your projects (or even to LINQ to SQL).

    Note: The URLs for NHContrib and NHibernate.LINQ are the same in Shawn’s post. NHibernate.LINQ doesn’t appear for me in the NHibernate Contrib’s Latest File Releases list.

    Added: 7/20/2008

    Emir Treviño Publishes Code Generator for Entity Framework with T4 Templates

    According to Emir, the SFS for Microsoft Visual Studio 2008 CodePlex project released on July 4, 2008 is an add-in to VS 2008 that increases the efficiency of code generation for Entity Framework with the Text Template Transformation Toolkit (T4). The project includes an initial example, ADO.NET Entity Framework to Any Layer, which generates classes for multiple-tier EF projects.

    Emir offers the following posts that describe how to use his SFS add-in:

    The project documentation and posts are also available in Spanish.

    Added: 7/20/2008

    SQL Server Data Services Team: Sprint 3 Scheduled for July 24-25, 2008

    My Sprint 3 for SQL Server Data Services Will Add Several New Features post of July 9, 2008 contained a list of the features expected to be implemented by Spring 3.

    In an email message of July 18, 2008, the SSDS Team set the upgrade window as follows:

    • START: Thursday, July 24, 2008 at 9:00 AM (PST)
    • END: Friday, July 25, 2008 at 9:00 AM (PST)

    The message also was more explicit about lack of SOAP support for blobs:

    “Blob Support via the SOAP interface will be delivered in a later update.”

    Rather than":

    “Blob support via the SOAP interface is coming.”

    From which one might infer that Spring 3 would include SOAP for blobs. Otherwise, the text of the Sprint 3 message is the same as in the preceding post.

    Added: 7/19/2008

    Mike Amundsen Adds a Console Version of His SQL Server Data Services Example Demos

    By a SSDS Console App Demo Posted to Codeplex message of July 17, 2008 in the SQL Server Data Services (SSDS) - Getting Started forum, Mike adds a console app for communicating with SSDS to his original ASP.NET version. Mike says:

    One of the cool features of this demo app is that you can now use Windows batch files (for example) to script interactions with SSDS. I included a simple example with the downloadable ZIP

    Added: 7/19/2008

    David Hayden Casts Vote for ASP.NET Dynamic Data Services Futures, Dynamic Data Runtime and Templates, and Dynamic Data for MVC Preview

    Dave’s ASP.NET Dynamic Data Futures and MVC Sample - Database-Driven Web Applications post of July 18, 2008 includes kudos for the 7/17/2008 Futures release (see “Marcin Dobosz Announces ASP.NET Dynamic Data Futures Update” below) and the Dynamic Data Runtime and Templates, and Dynamic Data for MVC Preview updates of 7/18/2008.

    Dave says:

    ASP.NET Dynamic Data fills a great void for developing forms-over-data web applications. I used it to build a quick intranet application for a client and they couldn't be any happier. …

    The ASP.NET Dynamic Data Runtime and Template Release on 7/18 fixes bugs in primarily the Dynamic Data Wizard. The ASP.NET Dynamic Data for MVC Preview shows off how to incorporate the wonderful scaffolding of Dyamic Data with the ASP.NET MVC Framework.

    All very cool stuff.

    Added: 7/19/2008

    Darrin Maidlow Documents His Struggles with Implementing NHibernate

    Developers new to NHibernate find implementing NHibernate for non-trival projects isn’t a piece of cake, as Darrin demonstrates in his RADE Milestone - Object Relational Mapping with NHibernate post of July 19, 2008. Darrin writes:

    NHibernate was a tough curve for me.  Initially, I started testing code generators.  After spending a significant amount of time reading, testing, and pulling out hair I came to the conclusion that NHibernate code generation is still not there. …

    Finally, get NUnit running.  I had a lot of problems using the built in Microsoft Test projects with NHibernate - so I'll be sticking with NUnit. If you've never done unit testing (you know who you are) do it.  Particularly in this case - its crucial.

    Darrin chose NHibernate over Entity Framework because he belived it supported SQL Server only:

    LINQ with the Entity Framework looks really cool and I've used it for some small research/test projects recently, but with the lack of support for database other than SQL server - it's not an option at this time.

    Apparently, he wasn’t aware of the large number of third-party Entity Data Model-enabled managed data providers for EF: See Recent ADO.NET Entity Framework provider news - Demos and downloads by David Sceppa.

    Added: 7/19/2008

    Soumitra Sengupta Maps SQL Server Data Services Entity Typing Futures

    In his Mike Amundsen is putting out lot of samples in his blog post of July 16, 2008, Soumitra addresses Mike’s concerns that aligning the SSDS API with ADO.NET Data Services (Astoria) complicates SSDS:

    I do not disagree with Mike that one of the core values of SSDS is its simplicity.  It is a tribute to the team that they have been able to keep it simple for developers to approach and use right away.  I appreciate Mike's concern that aligning SSDS with Astoria could make SSDS lot more complicated.  As I said in my response, the alignment does not mean that we are ditching the flex entity model.  Once we release the aligned service, as a developer you will have a choice of staying with the flex entity model or add schemas where it makes sense to add schemas.  We hope to provide this capability at the container level so you can choose to:

    a. Keep all entities as flex entities
    b. Keep all entities as typed entities
    c. Have both typed and untyped entities and type entities with open or flex properties

    The side effect is that the Astoria client library then becomes the default client library for developers to build their applications in Visual Studio.  Still does not solve the problem of client libraries for Java, Ruby and PHP.  I still got those on my plate to address.

    I’ll be interested to see how the team handles untyped, freeform (flex) entities combined with typed entities with a schema.

    Added: 7/19/2008

    LINQ to WMI Updated for .NET 3.5

    Emile Bosch created the original version of LINQ to WMI (Windows Management Instrumentation) in 2005 and Eden Ridgeway updated it to .NET 3.5 in January 2008.

    On July 17, 2008 “nyxtom” (who appears to be Thomas Holloway), ported the project to Linq2WMI on Codeplex. For consistency with other LINQ implementations, I’m rechristening it LINQ to WMI.

    By the way, the originators given name is Emile, not Emily.

    Thanks to Greg Duncan for the heads up on 7/19/2008.

    Added: 7/19/2008

    Tim Mallalieu Delivers a Preview of POCO for Entity Framework v2

    Tim’s Look Mom... no XML post of July 18, 2008 announces the the Entity Framework team “has just wrapped up” its first iteration of v2 and says:

    We are shooting to get another iteration in before PDC and are still working on how we can get early bits out to customers outside of the rhythms of the CTP's and such.

    One of the nifty things in our first iteration, though, was some of the work that we did around POCO. There is a lot more to be done with POCO, we need to still deliver lazy load, value objects and more. With these bits, however, it is possible to write basic POCO code now.

    He then goes on to describe use of the ContextFactory.CreateContext() method to create the Context and a POCO Product class and a Products ObjectQuery. Tim explains:

    The entry point for being able to use this code without artifacts is the ContextFactory. The ContextFactory reflects over the Context type that one wrote by hand. It looks for all properties of type ObjectQuery<T> and then uses these to define an in-memory representation of the models (conceptual, store, mapping) which are then passed to the metadata infrastructure.

    Added: 7/18/2008 1400 PDT

    “Data Dilemma” Cover Story for Redmond Developer News’ July 15 Issue

    My “Data Dilemma” cover story, sub-titled “Mapping a strategy for Microsoft's new data-programming models” for the July 15, 2008 issue of Redmond Developer News covers the ADO.NET data technologies included in Visual Studio 2008’s forthcoming Service Pack 1: ADO.NET Entity Framework, ADO.NET Data Services (formerly codenamed “Astoria”), and ASP.NET Dynamic Data.

    The article includes quotes on these new technologies from:

    • Michael Pizzo, principal architect, SQL Server Data Programmability Group
    • Andrew Brust, chief of new technology at twentysix New York
    • Ward Bell, VP of product management at IdeaBlade Corp.
    • Rockford Lhotka, principal technology evangelist for Magenic Technologies Inc.
    • Chris Kinsman, VP of development at Vertafore, Inc.
    • Elisa Flasko, community program manager, SQL Server Data Programmability Group
    • Troy Magennis, enterprise software architect, Corbis Corp., and curator of the Hooked on LINQ wiki
    • Frans Bouma, LLBLGen Pro lead developer at Solutions Design BV
    • Steve Naughton, developer of Web applications for the UK construction industry

    For more details about the article, see “Data Dilemma” Cover Story for Redmond Developer News’ July 15 Issue of July 16, 2008.

    Tim Mallalieu: Entity Framework v1 Wasn’t Designed to Compete with NHibernate

    NHibernate proponents probably would phrase the statement slightly differently: “Entity Framework isn’t competitive with NHibernate.”

    Tim’s Newsflash: EF V1.0 was not intended to be a NHibernate compete of July 17, 2008 recounts his dinner on July 15, 2008 with Scott Bellware, the author of the ADO.NET Entity Framework Vote of No Confidence manifesto, and Greg Young, both of whom certainly fall into the “NHibernate proponents” category. Tim says:

    Having the EF in the market creates noise for [Scott and his compatriots] because it becomes a technology choice between a Microsoft product that does not yet address this school of software development and open source solutions that do.

    Developers who’ve invested a substantial amount of time into Test-Driven Development (TDD), Domain-Driven (and now Behavior-Driven) Design (DDD and BDD) have the expected paranoia toward a heavily promoted Microsoft contender in the object/relational mapping (O/RM) tool market. At the very least, these folks will need to explain to current and prospective clients why they don’t use EF. At the worst, all-Microsoft shops might insist they use EF.

    Tim promises:

    I shall attempt to make a series of posts leading up to and following the advisory council where I go into a bit of the history and future. This will not yield a decision matrix for a developer but it may be interesting for folks.

    It will be interesting to see how Tim’s history compares with Matt Warren’s earlier The Origin of LINQ to SQL.

    Note: See below re “heavily promoted.”

    Fausto Ibarra Talks Up ADO.NET Entity Framework

    Fausto is the new Director of Product Manager for SQL Server, replacing Francois Ajenstat who’s moved to greener pastures in Microsoft’s green initiatives, according to Q&A: Fausto Ibarra Takes SQL Server Reins by Jeffrey Schwartz.

    Here’s the Q & A on the Entity Framework Front from the July 16, 2008 article in Redmond Developer News:

    Will you be coordinating this with the release of Service Pack 1 of Visual Studio 2008 and the .NET Framework and the Entity Framework?
    We are coordinating them. The Entity Framework will ship with .NET Framework 3.5 SP1 and it will ship roughly at the same time as SQL Server. When we talk about the Entity Framework, we talk about it from the perspective of SQL Server and from the perspective of the .NET Framework and Visual Studio. No matter where developers are coming from, we will talk to them about the Entity Framework and coordinating the messaging of both releases across all our different developer channels, like MSDN. [Emphasis added.]

    Notice that there’s no mention of LINQ to SQL in the article.

    Jürgen Bäurle Develops LINQ to SAP for Theobald Software GMBH

    According to Jürgen’s LINQ to SAP: How to use LINQ to connect to a SAP/R3 system Code Project article of July 17, 2008, LINQ to SAP from Theobald Software GMBH can query SAP Function Modules, Tables, BW (OLAP) Cubes and SAP Queries. Theobald Software’s primary product is ERPConnect.net, a .NET interface to SAP R/3.

    The article also describes LINQ to SAP’s graphical designer for Visual Studio 2008, which adds a LINQ to ERP template and autogenerates classes for SAP objects in a manner that’s vaguely similar to LINQ to SQL.

    Jürgen specializes in .NET/SAP development.

    Denny Boynton Interview at Tech*Ed 2008 IT Pro: Pragmatic Data Architecture

    In this interview video at Tech*Ed 2008 IT Pro by Paul Nielsen posted July 17, 2008, SQL Server architect-evangelist Denny Boynton stresses the importance of the hands-on project data architect, in addition to the more common enterprise data architect.

    From the official description:

    Some shops say architects should be hands off, other expect the data architect to be involved in projects – how do we resolve this issue? And if the data architect is involved in projects, what’s the best he or she can contribute? How do we measure quality of a database project? We believe there are six attributes of a database. This talk will cover these attributes and the practices that best contribute to these qualities.

    Mary Jo Foley Blames Microsoft’s Online Systems Business for Its Missed Earnings Projections

    Mary Jo’s Microsoft’s online plan: Spend, spend, spend column of July 18, 2008 begins:

    If you think Microsoft’s been spending like crazy in the online space, you ain’t seen nothing yet. (And that’s not counting when or if Microsoft’s multi-billion-dollar bid for Yahoo’s search business is ever consummated.)

    Microsoft missed earnings projections when it announced its Q4 FY 2008 numbers on July 17. To some company watchers’ surprise, it wasn’t Windows Vista — which Microsoft claims to have sold 180 million licenses now — that was to blame. Instead, yet again, it was Microsoft’s Online Systems Business (OSB), more than anything else, that dragged down the numbers.

    However, Microsoft officials told Wall Street analysts not to expect Microsoft to change its OSB investing-for-the-longhaul strategy any time soon. Microsoft is planning to step up its online spending around driving usage of Live Search and growing its advertiser base for its adCenter online-ad platform.

    However, OSB includes more than just Live Search and other ad-supported services. It also includes SQL Server Data Services (SSDS), Live Mesh synchronization, and the new Exchange Online, SharePoint Online, Office Communications Online and Office Live Meeting package that rents for $15.00 per month.

    Marcin Dobosz Announces ASP.NET Dynamic Data Futures Update

    His Dynamic Data Futures 7/16 update posted article of July 17, 2008 lists the following as what’s new in this week’s update on CodePlex:

      • Added ImprovedDynamicValidator control that fixes issues with DynamicValidator correctly catching exceptions thrown off a validated data model object. A tag mapping in web.config is used to automatically replace all instance of DynamicValidator with ImprovedDynamicValidator. This validator is also now added to the ForeignKey_Edit template.
      • Added EnumDataTypeAttribute that can be used to mark integral columns as actually representing enumerated CLR types.
      • Modified the Enumeration field template and filter template to take EnumDataTypeAttribute into account.
      • Modified the Enumeration filter template to detect if an enum is in flags mode and display a CheckBoxList instead of a DropDownList.
      • Added validation to the DbImage_Edit template. It now verifies that the provided file is a valid image and also that a file is provided at all if the column is required.
      • Added constraints to routes to illustrate how to block invalid requests.

    Phani Raju and Marcelo Lopez Ruiz Write SetBasedExtensions for Adding Set-Based Methods to Astoria

    Phani and Marcelo’s Set Based Operations in ADO.NET Data Services post of July 17, 2008 includes the complete source code for an extension method to facilitate set-based methods with a dynamic filter predicate. The post also includes a usage example.

    The extension method proves that Phani and Marcelo are LINQ Ninjas.

    dnrTV Offers Danny Simmons’ Introductory ADO.NET Entity Framework Screencast, Part 1

    Dan Simmons on The Entity Framework Part 1 of July 14, 2008 is the first of a two part introduction to the ADO.NET Entity Framework (EF). Here’s his bio:

    Daniel Simmons is dev manager for the Entity Framework and LINQ to SQL team where his mission is to build a team and a product that will fundamentally change the way we build data-centric software. He has been at Microsoft for 10 years working on a variety of products. Before coming to Microsoft he worked as a consultant, founded an ISP and engaged in various other software pursuits.

    I’d like to see parts 3, 4, … cover advanced EF topics.

    Joe Gregorio Publishes Introductory Video on Atom Publishing Protocol on You Tube

    Google’s Joe Gregorio is Google’s “main man” on the Atom Publishing Protocol (AtomPub, APP) that’s one of the wire protocols for ADO.NET Data Services and is schedule for support by SQL Server Data Services.

    This 9-minute video covers the basics of AtomPub’s Create, Retrieve, Update and Delete operations, adding media, and other topics. Surprisingly, the code is readable.

    Wriju Publishes LINQ to SQL Bibliography Update

    From the “How Did I Miss This?” Department

    His LINQ to SQL : Missing Manual are at MSDN post of July 3, 2008 shows that UserEd has been working overtime on LINQ to SQL topics. The post contains 18 links to MSDN library topics about LINQ to SQL; each topic includes a brief description.

    Thanks to Jim Wooley for the heads-up.