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

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.

Saturday, February 16, 2008

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

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

Updated: 2/15/2008 for the Amazon S3 outage and 2/16/2008 for the reason for the outage. See the "Justin Etheredge Offers Preview of LINQ to [Amazon] SimpleDB" topic.

Danny Simmons Deals with the ObjectContext Lifetime Dilemma

Danny's Context Lifetimes -- Dispose or Reuse? post of 2/17/2008 (yes, a Sunday post) attempts to answer its title's question based on "understanding the overall pattern of your app." (Other than "too slow" I suppose.)

On the whole, Danny's criteria for reusing and disposing also can be applied to LINQ to SQL DataContext objects, which are lighter weight.

The question, which I've asked in the comments, is how will the (hopefully) imminent ASP.NET EntityDataSource server control affect the recommendations?

Added: 2/17/2008

David DeWinter Starts Project to Synchronize LINQ to SQL DBML Files with Database Schema Changes

David's LINQ to SQL and Database Schema Sync post of February 16, 2008 describes his objectives in starting a project to keep his "generated entity classes in sync with the current database schema" by a mechanism other than clearing the designer surface and starting over. He cites many types of manual adjustments to the entities in the designer that must be made to many tables each time you drop them on the designer surface. The goal is to maintain a record of systematic changes for repetition on both unchanged and altered or added tables.

His second The LINQ to SQL Metamodel post of the same day describes his use of Project NORMA to enable Visual Studio 2008 to render Object Role Modeling (ORM) diagrams of Database, Connection, Table, Type, Column, Association, Function and TableFunction elements. (Some of the diagrams are amazingly complex.)

Note: The Entity Data Model's Model Browser has a similar feature called Update Model from Database that opens the Entity Data Model Wizard that lets you select items to add. The Wizard automatically updates existing and deleted items. My tests so far with the Beta 3 version have resulted in non-displayable models.

Added and subscribed: 2/16/2008

Dare Obasanjo Seconds the ADO.NET Entity Data Team's Decision to Adopt AtomPub for Updates

In his ADO.NET Data Services (Astoria) Adopts AtomPub post of February 16, 2008, Dare says:

I'm glad to see Microsoft making a huge bet on standards based, RESTful protocols especially given our recent history where we foisted Snakes On APlane on the industry. [Emphasis Dare's.]

However since AtomPub is intended to be an extensible protocol, Astoria has added certain extensions to make the service work for their scenarios while staying within the letter and spirit of the spec.

Dare then goes on to analyze in his Thoughts on Google's Proposal for Granular Updates in AtomPub post of February 16, 2008 Joe Gregorio's How to do RESTful Partial Updates proposal of February 15, 2008 for updating specific properties of an entry without retrieving and returning the entire entry. Dare's primary complaints are:

The main problem is that it changes the expected semantics of HTTP PUT in a way that not only conflicts with how PUT is typically used in other HTTP-based protocols but also how it is used in AtomPub. It's also weird that the existence of xml:id in an Atom document is now used to imply special semantics (i.e. this field supports direct editing). I especially don't like that after all is said and done, the server controls which fields can be partially updated or not which seems to imply a tight coupling between clients and servers (e.g. some servers will support partial updates on all fields, some may only support partial updates on atom:title + atom:category while others will support partial updates on a different set of fields). So the code for editing a title or category changes depending on which AtomPub service you are talking to.

Dare's solution:

If a field is important enough that it needs to be identifiable and editable then it should be its own resource. If you want to make it part of another resource then use atom:link to link both resources.

Added: 2/16/2008

Julie Lerman Creates ADO.NET Data Services PopFly Mashup

Julie's presenting a Web Mashups with ADO.NET Data Services session at DevConnections, so she decided to create a PopFly mashup with the aid of the Popfly Explorer plugin for VS 2008 [Express].

She recounts her experiences creating a simple read-only client with the NewsReader block in her ADO.NET Data Services + PopFly post of February 15, 2008.

Added: 2/15/2008

Microsoft Appoints Scott Guthrie Corporate Vice President for the .NET Developer Platform

Scott received a well-deserved promotion in Redmond's latest management reshuffling, as noted in a February 14, 2008 press release, Microsoft Announces New, Expanded Roles for Key Executives. From the release:

Scott Guthrie, corporate vice president, .NET Developer Platform. Previously general manager, Guthrie will continue to oversee several development teams responsible for delivering Microsoft Visual Studio developer tools and Microsoft .NET Framework technologies for building client and Web applications.

Congratulations, Scott. Hopefully, the rise in grade won't stem the flow of your great tutorial and useful linkblog posts. As I said in a comment to Joe Wilcox's Microsoft Puts on Midlife Executive Bulge post of February 15:

Of all the execs whose titles Microsoft bumped up yesterday, not one deserves a promotion more than Scott Guthrie. Scott's enthusiasm for the .NET development platform, as evidenced in his blog and technical presentations, continue to attract programmers of all skill levels to Visual Studio 2008 and .NET 3.5.

Other developer-oriented groups would do well to clone Guthrie's approach to marketing their platforms.

Microsoft also boosted Scott's boss, S. "Soma" Somasegar, from Corporate to Senior Vice President:

S. Somasegar, senior vice president, Developer Division. Previously corporate vice president, Somasegar will continue to oversee all developer-related languages, tools and platforms within Microsoft. He also leads Microsoft India Development Center and Microsoft Canada Development Centre.

Added: 2/15/2008

Updated 2/16/2008: .NET Rocks! interviewed Scott for show #316 (2/14/2008) about IIS 7.0, Silverlight 2.0, MIX 08 and other hot topics. Scott's 34-minute segment starts at 04:00.

Justin Etheredge Offers Preview of LINQ to [Amazon] SimpleDB

Justin's been working on LINQ to SimpleDB since shortly after Amazon opened SimpleDB's limited beta. His LINQ To SimpleDB Issues post of December 31, 2007 (before he had access to the beta) details the issues with dealing with numbers when the database only supports strings. I've missed Justin's LINQ-related posts on his CodeThinked blog up until now because it doesn't have high visibility for "LINQ" in search engine results.

Justin released LINQ to SimpleDB Alpha 1 (source code and runtime binary) to CodePlex on January 23, 2008 under the Microsoft Public License (Ms-PL). His LinqToSimpleDB Preview post of January 19, 2008 offers operating instructions. The Releases page describes the included functionality as:

  • Query SimpleDB Items by Attributes
  • Retrieve Attributes for items
  • Query items by Name
  • Create and Delete Domains
  • Create and Delete Items
  • Create and Delete Attributes

Note: My Amazon Announces Beta of SimpleDB Web Services in the Cloud of Post of December 14, 2007 and Dare Obasanjo's Amazon SimpleDB: The Good, the Bad and the Ugly post of December 21, 2007 analyze SimpleDB's feature set.

I plan to give LINQ to SimpleDB a test drive as soon a SimpleDB beta test slot becomes available.

Added: 2/14/2008

Updated 2/15/2008: All Amazon Web services (including SimpleDB) appear to have suffered a massive outage at about 4:30 AM Pacific time according to Nicholas Carr's post of this morning. The problem was reported to have been corrected at 7:30 AM but some users were still reporting problems at 8:30 AM, according to Michael Krigman's Amazon S3 web services down. Bad, bad news for customers. blog, "Rearranging the Deck Chairs: IT Project Failures."

Amazon's Service Level Agreement for S3 (which presumably would apply to SimpleDB when it's out of beta) is 99.9% availability during a monthly billing period. Assuming 30.5 days/month, 0.1% downtime is 0.732 hours.

Updated 2/16/2008: Nick explains in today's Why S3 failed update that:

It was not a hardware failure. Rather, the service's authentication system, which verifies the identity of a user, became overloaded with user requests. As one person explained to me, it amounted to a kind of accidental DDoS (distributed denial of service) attack, and Amazon didn't have enough capacity in place in one of its data centers to handle the surge.

Nick's post includes the official reason in a message from Amazon.com.

Mike Taulty Tabulates Entity Framework's Mapping Capabilities

Mike's ADO.NET Entity Framework Mapping Table post of February 14, 2008 begins with:

One of the things that's been really bothering me for quite a while now is the aspect of mapping in the Entity Framework.

Technical things can trouble me. I like to get them into my head, understood and then I can move on. I have a very, very bad memory and the only way I can remember anything is by understanding how it works and then I find it relatively easy to piece back together at a later point.

Strange that Mike should mention this. I'm bothered by the same questions about EF's mapping capabilities, despite the fact that I use them almost every day. I also have the same memory problem. So Mike put together a list of these capabilities with details examples. Here's a list of what he covers:

  1. Renaming an Entity Type
  2. Renaming an Attribute (although I'd call it Renaming a Property)
  3. Removing an attribute (ditto)
  4. Specifying a default value for an attribute that does not have a default value
  5. Overriding a default value for an attribute that has a default value
  6. Changing the data type of an attribute
  7. Changing the nullability of an attribute
  8. Multiple store tables, single entity type
  9. Single store table, multiple entity types or entity sets

For all my sample projects that use EF/EDM, especially those based on Northwind, I use:

  1. To singularize Entity Types, leaving the Plural for Entity Collections/Sets
  2. To singularize the name of navigation properties for Many:1 associations
  3. To remove images (e.g., Category.Picture and Employee.Photo)

But I hadn't thought of using 5 to add Today as Order.OrderDate's default value or 7 to change the nullability of value-type properties, such as Order.OrderDate, Order.Freight, Product. UnitPrice, etc. The latter might solve some of my issues with EF projects in VB (e.g. performance problems with COALESCE and no support for the Coalesce operator by the VB version of ADO.NET Data Services clients -- see below). Minimizing Nullable<T> data types also minimizes Nullable`1[System.Decimal]" type declarations in ADO.NET Data Services' Atom-formatted payloads.

Update 2/14/2008: Default values are constants of the property's type, so specifying the DateAndTime.Today property doesn't work. (Nor does it throw an exception).

I'd say the preceding list would make a good start for a series of ADO.NET Team blog posts, as well as the final EF documentation.

Added: 2/14/2008

Pablo Castro: ADO.NET Data Services and the Atom Publishing Protocol

Pablo explains the Project Astoria team's approach to adopting the Atom Syndication Protocol (Atom, RFC 4287) and Atom Publishing Protocol (APP, RFC 5023) as data-exchange (payload) formats in his AtomPub support in the ADO.NET Data Services Framework post of February 13, 2008.

The Astoria Team plans to post its proposed extensions and application-level features for discussion on the atom-syntax and atom-protocol mailing lists. Read more about the pending issues here.

Added and updated: 2/14/2008

Tercer Planeta's Working on a LINQ-Enabled Application Framework

Jose Marcenario and Benjamin Eidelman, principals of Tercer Planeta (Third Planet, a .NET consulting firm in Argentina), have determined that "it would be great to have a LINQ 'Queryable' data access layer." So they've "started to analyze LINQ-to-SQL integration in Enterprise applications of different scale."

Benjamin's initial post, First Thoughts on Designing a LINQ-enabled Application Framework of February 13, 2008, deals with issues arising from LINQ to SQL's infamous lack of "an out-of-the-box n-tier story" because DataContext objects aren't serializable.

He points to Manuel Bauer's InterLINQ project on CodePlex that serializes an expression tree and returns the query result. (InterLINQ is destined to become a component of the poor man's Model Driven Architecture for .NET project from HSR Hochschule für Technik Rapperswil, Switzerland' .NET Competency department). However, it doesn't appear that Tercer Planeta will take the InterLINQ route.

At the end of the post, Benjamin says:

These days we're starting to see the light and the end of tunnel, with custom tools and code we started to write.

More on this on following posts...

Added: 2/14/2008

VB-Specific Bugs in ADO.NET Data Services CTP

Today's Fix for "Known Bug" when Creating ADO.NET Data Services with Visual Basic and a Web Application post updates an ASP.NET 3.5 Extensions Preview Released post of December 10, 2008 included a "Data Services (Project Astoria)" topic that itemizes some errors in the QuickStart instructions for creating an ADO.NET Data Service.

The need to do a fixup by removing the default namespace for a VB ADO.NET Data Services project that uses a ASP.NET Web Application (rather than a file-system Web site) turned out to be a known but unpublicized bug.

There's another VB-related bug that's described in my LINQ Query Expression Fails in VB with 'Coalesce' Not Supported Error, C# OK post in the ADO.NET Data Services (Pre-release) forum. I'm waiting for a reply indicating whether that problem is known.

While I'm griping, the numeric operators documentation shows lteq and gteq instead of the correct le and ge for <= and >=, respectively. There's also an issue with the use of $expand in LINQ to REST and WebDataQueries, which has known problems.

Errata for docs and lists of supported and unsupported operators, etc., would be very useful for ADO.NET Data Services pilgrims (like me.)

Added: 2/13/2008

Charlie Calvert: Using the Expression Tree Visualizer

The latest in Charlie's LINQ Farm Seed series is LINQ Farm Seed: Using the Expression Tree Visualizer of February 13, 2008. This post gives detailed instructions on how to download the visalizer and use it to view the expression tree for a simple lambda function.

Added: 2/13/2008

Julie Lerman Records Entity Framework Podcast for .NET Rocks!

Julie's Just recorded DotNetRocks about Entity Framework post of February 12, 2008 describes her one-hour interview with Carl Franklin and Richard Campbell about the Entity Framework.

A major concern voiced in her podcast: DBAs' reluctance to accept dynamic SQL queries from Entity Framework or LINQ to SQL and ignorance of both implementations' capability to use stored procedures for all CRUD operations.

Mark your calendars: The podcast will be aired on February 26, 2008.

Added: 2/13/2008

James Newton-King Publishes LINQ to JSON Beta

According to James' LINQ to JSON beta post of February 11, 2008, LINQ to JSON is an API that's similar to LINQ to XML, not a LINQ provider. It enables a declarative syntax for writing JSON code and a query syntax for reading it. The post provides a simple RSS channel/items structure as an example.

LINQ to JSON is part of James' larger Json.NET project on CodePlex. According to the project's home page, Json.NET offers:

  • Lightning fast JsonReader and JsonWriter
  • The JsonSerializer for quickly converting your .NET objects to JSON and back again
  • Json.NET can optionally produce well formatted, indented JSON for debugging or display
  • Attributes like JsonIgnore and JsonProperty can be added to a class to customize how a class is serialized
  • Ability to convert JSON to and from XML

Json.NET 2.0 Beta 1 released on 2/11/2008 includes the following new features, changes, and bug fixes:

  • New feature - LINQ to JSON!
  • New feature - Ability to specify how JsonSerializer handles null values when serializing/deserializing.
  • New feature - Ability to specify how JsonSerializer handles missing values when deserializing.
  • Change - Improved support for reading and writing JavaScript constructors.
  • Change - A new JsonWriter can now write additional tokens without erroring.
  • Bug fix - JsonSerializer handles deserializing dictionaries where the key isn't a string.
  • Bug fix - JsonReader now correctly parses hex character codes.

Added: 2/13/2008

Bill Horst Struggles to Emulate a FULL OUTER JOIN with LINQ to SQL

Bill's Converting SQL to LINQ, Part 9: Full Outer Join post of February 12, 2008 demonstrates creating the equivalent of a T-SQL FULL OUTER JOIN command with one initial LINQ query and two concatenated subqueries.

Apparently, this is the last of Bill's posts unless users suggest a different topic.

Links to all nine topics are available here.

Added: 2/12/2008

Alex James Reaches Part 4 of His Bulk Updates with Entity Framework Saga

If you want to avoid bringing a large number business objects into memory for bulk updating, Alex has the solution. In his Rolling your own SQL Update on top of the Entity Framework - Part 4 post of February 12, 2008, he shows you how he builds the final UPDATE [Table] SET Column = value, .... WHERE Key IN (...) query from Part 3's GetQueryInfo() method.

What would be interesting is a comparison of the performance of Alex's approach with the out-of-the-box bring-the-objects-into-memory-make-changes-and-invoke-SaveChanges() approach.

Following are links to Alex's three previous parts:

Added: 2/12/2008

Kathleen Dollard Moves from XSLT to LINQ to XML Literals for Code Generation

dnrTV's Kathleen Dollard on Code Generation in .NET video of February 1, 2008 describes Kathleen's recent development efforts in moving from XSLT to LINQ to XML literals. You can see an example of a language specific LINQ to XML literal template starting at 15:30. Language-independent (C# and VB) template generation examples follow.

Despite the fact that Kathleen doesn't like Microsoft's SingleFileGenerator approach, she plans to move to .edmx files for templates because they enable mapping between tables and objects.

Beth's two earlier dnrTV videos about VB 9.0 and C# 3.0 are at:

Thanks to Beth Massi for the heads up.

Added: 2/12/2008

Brian Dawson Continues His Entity Framework Performance Series

In his Exploring the Performance of the ADO.NET Entity Framework – Part 2 post of February 11, 2008, Brian starts by describing caching of Entity SQL queries and its dramatic affect on query execution time: 179 ms. for the first vs. 15 ms. for subsequent executions. The same LINQ to Entities query executes in 202 ms. vs. 18 ms.

Brian then goes on to describe the benefit of compiling LINQ queries, which increases the initial execution time to 305 ms. and reduces subsequent execution times to 15 ms. (Brian says "It’s true that in this case subsequent executions of the compiled LINQ query are slower than those of the non-compiled LINQ query," however, the data indicates otherwise.

Changing the MergeOption to no tracking has a dramatic affect on subsequent executions of compiled queries: 3 ms. vs 15 to 17 ms.

Brian concludes:

  • Initial creation of the ObjectContext includes the cost of loading and validating the metadata.
  • Initial execution of any query includes the costs of building up a query cache to enable faster execution of subsequent queries.
  • Compiled LINQ queries are faster than Non-compiled LINQ queries.
  • Queries executed with a NoTracking merge option work well for streaming large data objects or when changes and relationships do not need to be tracked.

Added: 2/12/2008

Stefan Sedich Discovers Cause of Slow LINQ to SQL Performance with VB

Stefan's Different SQL between VB.NET and C# LINQ to SQL SOLVED!! post of February 12, 2008 describes the cause of VB's added (COALESCE(CASE ... )) clauses: VB treats database fields that allow nulls differently from C#. Note that Northwind tables allow nulls in foreign-key fields that would throw referential integrity exceptions if set to null.

See the "Dramatically Poorer Performance of VB Than C# LINQ to SQL Queries" topic of LINQ and Entity Framework Posts for 2/4/2008+.

Added: 2/12/2008

DinnerNow.NET Updated for VS 2008 RTM

The open-source DinnerNow.NET sample ASP.NET application has been updated to .NET 3.5 and VS 2008 RTM. According to the CodePlex release site, the following new .NET 3.5/VS 2008 features have been added:

  • LINQ to SQL
  • WF/WCF integration
  • IIS7 & Windows Activation Services (WAS) hosting for WCF services
  • WCF 3.5 Syndication Services
  • WCF on the .NET Compact Framework 3.5

The DinnerNow 2.5 release has also been tested for compatib[ility] with Windows Vista, Windows Vista SP1, and Windows Server 2008 RTM.

You can download the bits from DinnerNow.net on CodePlex.

The Visual Studio 2008 Training Kit uses DinnerNow.NET in several of its online Labs.

Thanks to Guy Burstein for the heads-up.

Jim Wooley Upgrades the Personal Web Starter Kit's Data Tier from ADO.NET to LINQ to SQL

The Personal Web Starter Kit (PWSK) is a sample ASP.NET application that lets users organize individual photo files into albums stored in an SQL Server Express database. You can download the original version here.

Jim's Personal Web Starter Kit LINQed up post of February 10, 2008 shows you how he refactored PhotoManager.vb to replace ADO.NET SqlClient stored procedure calls with LINQ to SQL's parameterized dynamic queries. You can read more about Jim's PSWK version and download the upgraded project at his LINQ enabled Personal Web Site Starter kit site in the MSDN Code Gallery.

Jim also provides a set of guidelines for migration from SqlClient to LINQ to SQL in his LINQ Migration hints of the same date.