Showing posts with label IPOCO. Show all posts
Showing posts with label IPOCO. Show all posts

Saturday, March 22, 2008

LINQ and Entity Framework Posts for 3/17/2008+

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

Updated 3/22/2008 for confirmation that SSDS "will support the full EDM/EF/ADO.Net V3 model in due time," per Soumitra Sengupta. (That's the primary justification for including SSDS-related posts in this blog.)

Updated 3/23/2008 by adding Ruurd Boeke's Sneak preview: serializing objects with original values post of 5/17/2008 (missed), which adds information about the IEditableBusinessObject class, to the "Ruurd Boeke Plans a Entity Framework Variant with a Lightweight Client" topic.

David DeWinter Adds Dynamic Menu Commands to his LINQ to SQL Database Update Sync Project

Dave started a project in January 2008 to write a Visual Studio 2008 plug-in with capabilities to:

  1. Transform property names to be Pascal case
  2. Remove prefixes from the names of database objects
  3. Automate mapping the types of columns to various (developer-defined) enumerations

for LINQ to SQL projects.

The following posts supplement his source code in CodePlex's Entity Framework Contrib (EFContrib) section:

Added: 3/23/2008

Dave Robinson Posts Source Code for an Excel Add-in That Saves and Retrieves Worksheets to/from SSDS

Dave, who's the "new SSD blogger" I mentioned in the "New SQL Server Data Services Blogger and a Third-Party View of SSDS (et al.)" topic below, has written an Excel 2007 add-in that stored worksheet data to and retrieves it from a SQL Server Data Services container. His Using Excel with SSDS post of March 21, 2008 includes the SSDS-specific source code.

He promises a later post that demonstrates syncing data with the Microsoft Synchronization Framework.

Added: March 22, 2008

Beth Massi Plans Yet Another VB and XML Webcast on April 4, 2008

Beth's Live From RedBethmond: VB9 - Working with XML in Visual Basic post of March 21, 2008 gives the following description:

4/4/2008 9:00 AM Pacific Time (US & Canada) | Duration:60 Minutes
XML permeates every modern application today from XHTML, XAML, RSS, SOAP, Office Open XML just to name a few. Even your Visual Studio project files and configuration settings are XML files. The latest version of Visual Basic in Visual Studio 2008 supports a new language syntax aimed at making you much more productive when working with XML. In this Webcast we'll walk through language features like XML literals, embedded expressions and axis properties in order to create, query and transform XML with this powerful but easy to use syntax. Say goodbye to XSLT and hello to Visual Basic 9.

Added: March 22, 2008

The SQL Server Data Services Team Wants to Answer Your Questions about SSDS

Jeff Currier posted What questions do you have about SQL Server Data Services? on March 21, 2008. His post contains this question:

I've written several posts now around coding (in C# and in Java) about using SSDS.  So, I'm a bit curious if anyone out there has specific questions that either I (or others on team) might be able to answer.  This could be code related, design related, etc.  So, what questions do you have?

My questions were (paraphrased):

  1. How and when do you plan to support associations/relationships plus lazy/eager loading?
  2. How and when will applicants be notified of acceptance or rejection as beta invitees?
  3. What's the timeframe for adding the promised Atom/AtomPub format?

I probably should have omitted lazy loading from question #1.

Added: March 21, 2008

Update March 22, 2008 from Soumitra Sengupta in his Answering a few questions from Jeff's blog response to my questions:

1. What are your plans and timing for supporting associations/relationships plus lazy- and eager-loading?

Answer to the first question is that we will support the full EDM/EF/ADO.Net V3 model in due time.  It is a bit of work.  We do not have exact timing for it.  Once we do that we will have to address lazy and eager loading, right?

2. When will folks who signed up for the beta know if they've been accepted?

First batch should go out next week.  We will keep provisioning on a weekly basis from there on out.  By the way once the first batch gets provisioned, everyone else should be able to get to the technical documentation.

3. What's the schedule for an Atom/AtomPub implementation?

We are on this one.  Do not have the exact schedule to share at this time.

Good news on all but the timing of #3, but especially #1.

Soumitra's post also responds to questions from several other readers.

Ruurd Boeke Plans a Entity Framework Variant with a Lightweight Client

Ruurd's Progress on light objects on the client, full blown EF entities on the backend post of March 21, 2008 describes his work to date on an n-tier variation on the Entity Framework (EF) that eliminates the need to deploy the entity framework to the client tier. His objectives are:

What I want is one visual studio project: 'Domain' that holds business objects for me that I can use on both the client and the server. What I do not want, is to have to think about Entity Framework contexts on the client. Since I do not persist my objects on the client, I see no reason to actually create a context on the client, just to be able to do change tracking. Nor do I want to see any EF specific plumbing in the messages between that client and server: I lose interoperability if I do that. Also, if my client is Silverlight (for instance) I might not want to bring the EF assemblies over (if that's even possible?).

So, the end result should be an easy way to serialize and deserialize objects on the client and server, and a way to build up the object correctly on the server so it can be attached to the context again.

Updated 3/23/2008: The client objects will be implementations of Ruurd's IEditableBusinessObject interface, which he describes in his earlier Adding Edit support to businessobjects post of March 16, 2008 and Sneak preview: serializing objects with original values of March 17. The "Ruurd Boeke Adds Complex Types to His IPOCO Entity Framework Implementation" topic of LINQ and Entity Framework Posts for 3/10/2008+ contains links to his earlier Entity Framework posts.

The Sneak Preview poses describes his classes for serializing objects with original values:

EditableBusinessObject implements IEditableObject for you and also allows you to copy the currentvalues to a loadedvalues state.

CreateSerializeSurrogate generates a surrogate class that knows how to deal with loadedvalues and with circular references.

It appears to me that Ruurd's objectives are similar to those of IdeaBlade for their DevForce EF project, which is presently in beta. Ruurd's client is likely to be much lighter, which would make it more appropriate for deployment in a Silverlight project. However, IdeaBlade is hard at work on a Silverlight 2 client that uses a version of their existing DevForce framework (see below).

Added: March 21, 2008

IdeaBlade Posts 45-minute Screencast of their DevForce EF n-Tier Entity Framework Implemetation

You can play the Camtasia screencast from a link on IdeaBlade's main DevForce EF page. The product looks quite interesting to me. Both IdeaBlade and Ruurd Boeke avoid serializing and transporting the ObjectContext across process boundaries.

Thanks to Julie Lerman for the heads up on the video's availability.

My original post about DevForce EF was the "IdeaBlade Offers Downloadable Beta of DevForce Entity Framework" topic of LINQ and Entity Framework Posts for 3/10/2008+.

Added: March 21, 2008

Mike Taulty Writes an Essay On Disposing LINQ to SQL Data Contexts

Mike normally encloses his LINQ to SQL data access code in a Using block to ensure that it's disposed expeditiously, closes the SqlClient connection and returns it to the connection pool as quickly as possible. I do the same if I don't want to cache collections as a generic List in a WinForm or Silverlight project.

Unlike me, Mike decided to determine whether the Using block was necessary to close the connection immediately, rather than waiting for finalization.

Read Mike's LINQ to SQL and SqlConnection post of March 20, 2008 to learn what he discovered.

As a bonus, you can download the demo code from Mike's LINQ Talk at UK Visual Studio 2008 Launch. Mike's LINQ to SQL demo starts with:

using (DataContext ctx = new DataContext(
      "server=.;database=northwind;integrated security=sspi"))

Added: 3/20/2008

New SQL Server Data Services Blogger and a Third-Party View of SSDS (et al.)

"Life in the clouds..." is the name of David Robinson's new SSDS blog. Dave is a program manager for SSDS and plans to evangelize SSDS on The Code Trip at the University of Southern California on March 27, 2008 and the Microsoft Health & Life Sciences Developer and Solutions Conference 2008 on April 22-24. The following is from his first post:

What’s this blog all about you ask? Well it is going to be mostly focused on developing solutions on top of SSDS, but there will also be tidbits of other cool technology and an occasional rant or two.

Dave's most March 19 post points to Max Zilberman's SQL Server Data Services (SSDS) - a powerful proposition... post of March 18, 2008. Max, who works in Philadelphia as an Enterprise Software Architect for a Fortune 100 firm, says this about SSDS:

Many blogs have written about the nice bits announced at the MIX such as IE8, Silverlight Mobile, Silverlight 2.0 Beta, among others.   The session that was not given high level of attention, the SQL Data Services sent a really powerful message.

And goes on to explain why hosted data services make business sense.

Max also has nice things to say about ASP.NET Dynamic Data and ADO Entities - The new beginning.....

Added: 3/20/2008

An ASP.NET Model-View-Controller Tech Brief, Mock Frameworks and LINQ to Mock (Moq)

My ASP.NET MVC: Is the new MVC pattern right for you? TechBrief for Redmond Developer News' March 2008 issue points out that Scott Guthrie makes the following claim for ASP.NET's MVC feature:

.NET MVC ships with System.Web.IHttpRequest and IHttpResponse interfaces; this simplifies mocking the interfaces to deliver improved unit-test performance.

Scott Hanselman followed up his ASP.NET MVC Preview 2 session at MIX 08 with the ASP.NET MVC Session at Mix08, TDD and MvcMockHelpers post of March 7, 2008. This item includes MvcMockHelper source code for RhinoMocks, which Scott demonstrated in his session, Moq, a.k.a. LINQ to Mock, and TypeMock, a commercial framework. The helper code for all three frameworks is of similar complexity.

Scott had previously reviewed MOQ in his Moq: Linq, Lambdas and Predicates applied to Mock Objects of December 19, 2007, which starts with:

Kzu and friends have a new pet project called Moq, which may be the coolest derivative open source project name ever.

And ends with:

Slick. Moq is definitely a project to watch.

In between, Scott compares NMock, RhinoMock, TypeMock and Moq.

The "Daniel Cazzulino and Juan Wajnerman Create LINQ to Mock (Objects)" topic of LINQ and Entity Framework Posts for 12/17/2007+ has more details on the release of LINQ to Mock. (From the "Scott Hanselman Endorses LINQ to Mock (Moq)" topic of LINQ and Entity Framework Posts for 1/7/2008+.)

Kaz posted his Why do we need yet another NET mocking framework? essay on March 17, 2008. Justin Etheredge's Asp.net MVC Testing Imbalance of March 19, includes sample Moq code for a simple MVC Update action. Here's his complaint about the amount of mocking code required for a relatively simple unit test:

And that doesn't even include any of my helper objects or methods. Anyone see a problem with this? I am going to have to put some serious effort into streamlining this. I know that there is quite a bit I can abstract out across different controllers and actions so we will see how this goes.

I have the same problem with the mocking frameworks I've investigated. Regardless of the complexity issue, Moq is gaining well-deserved attention.

Updated 3/23/2008: Justin's Simplified Asp.net MVC Controller Testing with Moq of March 22, 2008 post simplifies the UserControllerUpdateTest() method by refactoring with helpers, such as CreateMockUserRepository() and CreateMockUserController() methods and a MockHttpContextContainer() class.

Added: 3/20/2008

Updated 3/21/2008: David Longnecker offers two posts on unit testing ASP.NET MVC projects: Exploring the ASP.NET MVC Preview 2 - First Glance and Exploring the ASP.NET MVC Preview 2 - Tests and Mocks, both of March 20 2008. The latter uses LINQ to Mock (Moq).

Eugenio Pace Continues His LitWareHR for SQL Server Data Services Saga

His LitwareHR on SSDS - Part II - The data access layer explains that the new client data model for SSDS implements an SSDS SOAP Client, ProxyFactory and Repository<T> stack, which replaces the previous SQL Server-based version's Data Access Application Block (DAAB) and MultiTenantDataAccess layer.

His entity-specific classes derive from the ExtensibleEntry base class, which provides the Id property required by SSDS, as well as Code and Location properties, which are common to all LitwareHR entities. His example contains a simple unit test to verify Insert() invocations by invoking an InsertKindGetByIdDelete() TestMethod.

The "Eugenio Pace Starts a Series on the LitwareHR Demo on SQL Server Data Services" topic of LINQ and Entity Framework Posts for 3/10/2008+ covers the first part of this series.

Added: 3/19/2008

Jimmy Bogard Finds XML-File Mapping Delivers Persistence Ignorance to LINQ to SQL Business Objects

Jimmy purchased a copy of LINQ in Action and discovered that you have four choices for mapping SQL Server tables to LINQ to SQL entities and associations:

  1. Visual Studio 2008's graphical O/R Designer
  2. The SqlMetal.exe command-line tool
  3. Custom class files you write to define entities with mapping by attributes you add to the classes and their properties
  4. A custom XML mapping file you create and process with SqlMetal.exe

He concludes that choice #4 provides persistence ignorance.

But his Mapping options in LINQ to SQL post of March 18, 2008 concludes:

For me, the final verdict is: Though LINQ to SQL gives me powerful strongly-typed querying abilities with LINQ, the only maintainable mapping option still pales in comparison to NHibernate.

Added: 3/19/2008

Jason Hunter Demos a Master/Detail Form with a SQL Server Data Services Back End

In his SSDS Patterns Part 1: Master/Detail in a Heterogeneous World post of March 18, 2008, Jason creates the classic Windows read-only master/detail form that displays a drop-down list of Customers, a DataGridView for Orders from the customer, and another DataGrid view of details (Lines) for the selected Order. He shows the minimal source code to populate the list and bind to the BindingSource controls for the DataGridViews to the objects created from the SQL Server Data Services (SSDS) entities with XML serialization code.

Jason, who's a dev lead in the SSDS group, promises his next post will demo "XML serialization to bridge the gap between SSDS and objects."

See the related "Jeff Currier Shows Source Code for SQL Server Data Services HttpRequest and HttpResponse Methods>" topic below.

Added: 3/18/2008

Danny Simmons: An Essay on Deleting Entity Framework Entities

Danny's Just delete it already! post of March 18, 2007 describes in detail why deleting a "fake" entity with associated entities in the data access layer requires more than just creating the entity and it's EntityKey, attaching it to the ObjectContext, and then invoking DeleteObject(). The incentive for faking an entity is saving a roundtrip to the data store to retrieve it.

You must have access to the associated entities so you can delete their AssociationSets in the process. This means you must execute an ObjectQuery to retrieve them. In this case, you might as well retrieve the entity from the data store, because it will retrieve the entity of interest and its associated objects (as the "relationship span") with a single query.

Deleting many:1 EntitySets for AssociationSets represented in the store by nullable foreign key values isn't a problem. In this case, the generated SQL statement just sets the foreign-key value to null. Deletions become more complicated when associations are required by specifying NOT NULL foreign key values in the database. Deleting 1:many EntityReferences isn't a problem whether they're required or not; cascading deletion simply removes the dependent entities associated with the deleted parent along with the relation.

More about issues with deleting many:1 EntityRefs for required AssociationSets will follow.

Added: 3/18/2008

Greg Duncan Insists on Stored Procedures for Production LINQ to SQL Queries

Greg is Development Manager/Primary Developer for KMPG's Electronic Data Discovery (EDD) product line. Greg describes EDD as

Taking "electronic data" (files, emails in PST/NSF's,etc) gathering metadata, deduping, converting to PDF/Tiff/JPG and exporting for loading into litigation support systems.

His LINQ to SQL NOLOCK'ing post of March 18, 2008 includes a quote from Scott Hanselman's Getting LINQ to SQL and LINQ to Entities to use NOLOCK post of March 17, 2007, which suggests replacing the NOLOCK hint for queries with TransactionScope and System.Transactions.IsolationLevel.ReadUncommitted. Either prevents long-running transactions from blocking reads but can lead to retrieving inconsistent data.

Greg says "I use the NOLOCK hint in my SQL 2000 world a bit" and goes on to say:

Now that said, I'm still not going to "endorse" LINQ to SQL for production usage yet at work, UNLESS our existing stored procedures (or new SP's) are used. And you know what? SP's work nicely with LINQ to SQL. I was able to drop some tables into the design surface, drag over some SP's, set some properties and I was LINQ'ing quite well. Select, inserts and updates working easily all the time through our SP's. There were quite a few "oh that's just cool" moments.

Why SP's? Because they have saved my bacon a number of times over the years (I've been coding against SQL Server since 4.21a...). Practical real world experience has re-enforced my belief in SP's as my primary DB level API. Not a religious thing, just an experience thing...

LINQ to SQL's graphic designer makes substituting stored procedures (sprocs) for parameterized dynamic T-SQL in CRUD operations easy, but doing the same in Entity Framework involves manually editing the SSDL and MSL files with Visual Studio 2007's (or another) XML Editor. The XML editor has schemas for *.edmx, *.csdl, and *.ssdl files to support IntelliSense, but not for *.msl files. Mapping and testing sprocs for associations/relationships is an agonizing process.

The Stored Procedure Support (Entity Framework) online help topic for ADO.NET Entity Framework Beta 3 provides simple examples. See the ADO.NET Team's "Using Stored Procedures for Change Processing in the ADO.NET Entity Framework" post of March 8, 2007 and "How to Map Stored Procedures using the ADO.NET Entity Framework" post of September 14, 2007 by Mike Dodaro for examples with more detailed explanations.

If you're working with Entity Framework and your DBA insists on stored procedures for updates, you might try getting an exemption by explaining the mapping issues involved.

Added: 3/18/2008

Jim Wooley Explains LINQ Joins on Composite Keys

In Joining composite keys with LINQ of 3/17/2008, Jim observes that

[T]he Join extension method does not support the ability to provide the InnerKeySelector/OuterKeySelector as a series of expressions.

But the solution isn't obvious. Here's his VB expression for a join on City + State composite key:

Dim query1 = _
    From l In dc.LendingLimits _
    Join p In dc.Properties _
    On New With {l.County, l.State} Equals _
          New With {p.County, p.State} _
    Where p.PropertyId = SearchValue And _
          l.EffectiveDate = TargetDate _
    Select l.Amount

Cool!

Added: 3/18/2008

Rob Conery Waxes Enthusiastic over Lambda Functions

Rob appears to have fallen in love with Lambdas. As he says in his My Personal Lambda Crusade post of March 17, 2008:

I love lambdas and I’m pretty sure they solve every problem imaginable. Why just the other day my daughter painted her face with leopard spots, using a Sharpie pen, and I said to myself "Rob(x=>x.Beer("immediately"))" and all of a sudden the world was a brighter place…

His post includes a link to "a very good read." It's Howard Dierking's Lambda, Lambda, Lambda! post of January 18, 2008, which has one of the best explanations of an expression tree I've ever come across. Howard's the Editor-in-Chief of (and tech lead for) MSDN Magazine.

Added: 3/18/2008

Jeff Currier Shows Source Code for SQL Server Data Services HttpRequest and HttpResponse Methods

Jeff's Some SQL Server Data Services Coding Examples post of March 16, 2008 include C# samples for making RESTful HttpRequest.CreateRequest calls that accept URI, HttpMethod, data, and contentType parameters, as well as and reading responses with a custom ReadResponse(HttpWebResponse) method that returns the data as a string.

A more user-friendly version requests and returns a list of an Authority's Containers that Jeff imports into a LINQ to XML XDocument and binds it to an ASP.NET dropdown list. He then constructs a query of the selected Container and binds a list of entities with Kind = Customers to a GridView control.

Jeff promises to post a similar demo for SOAP request and response messages as well as for Java.

(Jeff's originally from the WinFS group. His first blog post is a recommendation to catch the "DAT416  Building on WinFS: Developing a Great WinFS App from Scratch" session from Tech*Ed 2006!)

Ruurd Boeke Describes How to Build an Entity Data Model Client without an Entity Framework Reference

His Adding Edit support to businessobjects post of March 16, 2008 says:

I'm building toward a set of tools that will enable me to use EntityFramework on the server and use the same businessobjects on the client-side, without having to reference EntityFramework at all.

This first post implements an IEditableBusinessObject, which inherits from IEditableObject. Ruurd uses PostSharp's OnFieldAccessAspect to intercept properties and add their values to the statebag. His "next step will be to get this [object] to serialize nicely, with original values and such."

For more background on the EDM server side, see the "Ruurd Boeke Adds Complex Types to His IPOCO Entity Framework Implementation" topic of LINQ and Entity Framework Posts for 3/10/2008+.

Saturday, February 23, 2008

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

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

Alex James Posts a Teaser About Entity Framework Support for Associations with Payloads

As Alex mentions in his Associations with Payloads post of 7/24/2008, Entity Framework (EF)automatically creates a many:many association instead of an entity for a table that consists entirely of two (or more) foreign key fields.

If you add payload field(s) to the table, such as Quantity [,UnitPrice, Discount, etc.], EF treats the table as an entity with one:many and many:one associations with its related tables.

Alex says:

It turns out however that with a little jigger pokery in the CSDL, MSL and SSDL it does support them, sort of.

However he doesn't provide the "jigger pokery," which I assume is Kiwi for "hack" or the like, but says it's coming in the next post. Since his last preceding post was February 11, you might be in suspense for a couple of weeks.

Added: 2/24/2008

Update 2/26/2007: See LINQ and Entity Framework Posts for 2/25/2008+ for the outcome.

Scott Hanselman Uses LINQ to XSD as an Example of How Microsoft Projects  Appear to be Abandoned

In LINQ to Everything - LINQ to XSD adds more LINQiness of February 22, 2008, Scott says he hears the following about many small Microsoft projects:

"Is _______ dead? I haven't heard anything in a month from _____ team's blog! It must be dead.

and then goes on to describe the benefits of augmenting LINQ to XML with LINQ to XSD using the arcane Open Financial Exchange (Ofx) XML schemas. (Microsoft, CheckFree, and Intuit initiated Ofx, which appears to have a semi-active blog.).

I suggested in a comment:

Another way to indicate a project isn't dead is to respond to questions about its status in the appropriate MSDN forum.

I requested the status of LINQ to XSD for .NET 3.5 RTM in a LINQ Project General forum Status of LINQ to XSD for RTM? on November 17, 2007. Two others seconded my request.

Not a word from the XML team.

I'm trying again with a status request for Shyam Pather's LINQ to Stored XML implementation, but I'm not optimistic about the result.

See the "LINQ to XSD Alpha 0.2 for VS 2008 RTM Is Available for Downloading" topic below for more details and background on the new release.

Added: 2/23/2008

Jim Wooley Uses LINQ to XML to Query All Shakespeare Plays Very Quickly

Jim's Querying the complete plays of Shakespeare using LINQ to XML post of February 22, 2008 describes his quest to find with LINQ to XML the fifty characters (SPEAKERS) in 37 plays having the most LINEs. The total size of the 37 files he concatenated into a single collection of XElements is about 7.75 MB.

Jim says:

The amazing thing with this process, running all three queries here, including the one which loads the full XML from the various files takes less than a second. I haven't had time to do a full performance test, including memory load, but the initial results are quite impressive! [Emphasis added.]

I agree.

Added: 2/23/2008

LINQ to Objects and LINQ to XML Videos from Tech*Ed 2007 Developers Barcelona Start with Disclaimer

Charlie Calvert's Video of Luke Hoban's In-Depth Look at C# 3.0 post of February 22, 2008 points to videos of these two presentations:

These are the first videos of presentations from Microsoft events that start with a disclaimer. Fortunately, you don't need to choose the "I have read the disclaimer and agree to be bound by it" option to watch the segment. I'm waiting for the first conference that requires agreement to a disclaimer as a condition of registration.

Added: 2/23/2008

Scott Guthrie: Silverlight 2.0 Beta 1 Will Support LINQ to XML

Scott's First Look at Silverlight 2 post of February 22, 2008 says that his team is "shortly going to release the first public beta of Silverlight 2" and notes that:

It also includes LINQ and LINQ to XML library support (enabling easy transformation and querying of data), as well as local data caching and storage support.  The .NET APIs in Silverlight are a compatible subset of the full .NET Framework.

It's amazing that the Silverlight team has been able to incorporate such an amazing array of new features in such a small package:

The Beta1 release of Silverlight 2 is 4.3MB in size, and takes 4-10 seconds to install on a machine that doesn't already have it.

Added: 2/22/2008

Jon Skeet Offers a Animated LINQ to Objects Visualizer

Jon's Visual LINQ: Watch query expressions as they happen! post describes an animated WPF project that displays the dynamics of LINQ to Objects query processing. You can download the source code, watch a screencast, or both.

Added: 2/22/2008

LINQ to XSD Alpha 0.2 for VS 2008 RTM Is Available for Downloading

Shyam Pather, Dev Lead for the XML Team, says in his LINQ to XSD Alpha 0.2 post of February 21, 2008:

I’m happy to announce that today we are re-releasing the LINQ to XSD Preview Alpha 0.2 for Visual Studio 2008. The previous preview release of LINQ to XSD targeted Beta 1 of Visual Studio 2008 but did not work on later builds. Many of the people who originally downloaded and tried the LINQ to XSD Preview Alpha requested an update for the final release of Visual Studio 2008 – this release is it. You can download it from here.

I'm one of the one of "the people who originally downloaded and tried the LINQ to XSD Preview Alpha" who "requested an update for the final release of Visual Studio 2008." See my LINQ to XSD Redux and LINQ to Stored XML Coming post of December 4, 2007 (Updated 1/14/2008) for more background on the original development of LINQ to XSD by Ralf Lammel.

Good news! Now what we need from the XML Team is a progress report on LINQ to Stored XML.

Added: 2/21/2008

ADO.NET Team: LINQ to SQL Support for New SQL Server 2008 Features "Coming Soon"

According to Faisal Mohamood, LINQ to SQL Program Manager, in his Coming soon to LINQ to SQL post of February 21, 2008:

Things aren’t so quiet over here on our end, even if it looks that way. The team has been busy adding features so that you will have better support for SQL Server 2008 in the future. Things we’ve been working on include support for new T-SQL data types that are being introduced in SQL Server 2008 – namely DATE, TIME, DATETIME2 and DATETIMEOFFSET, so that you can enjoy the same rich LINQ support and CUD support over data that uses many of the new types that are being introduced in SQL Server 2008.

Stay tuned and watch this blog for more on this as we get closer to releasing some of this and other new functionality!

Sounds to me like the LINQ to SQL upgrade is a candidate for VS 2008 SP1.

Added: 2/21/2008

VS 2008 SP1 Appears to be in the Works Before the Product's Official Release

The ReadMe file for SSCE 3.5 SP1 Beta for EF Beta 3 contains the following statement and admonition:

Microsoft SQL Server Compact 3.5 SP1 is the service pack release for the SQL Server Compact 3.5. SQL Server Compact 3.5 SP1 releases with SQL Server 2008 and Visual Studio 2008 SP1. [Emphasis added.]

Important:

All references to SQL Server 2008 and Visual Studio 2008 SP1 in this SQL Server Compact 3.5 documentation refer to a pre-release version of SQL Server 2008 and Visual Studio 2008 SP1. [Emphasis added.]

The SQL Server Compact Release Versions post of February 8, 2008 (updated for build 3.5.5626) contains a table with the following three latest entries for SSCE releases:

Product Name Release Vehicle Version

SQL Server Compact 3.5 SP1 Beta for ADO.NET Entity Framework Provider Beta

Download Center

3.5.5626

SQL Server Compact 3.5 SP1 Beta

SQL Server 2008 CTP6

3.5.5626

SQL Server Compact 3.5 SP1 Beta

Visual Studio 2008 SP1 Beta

 

These are the first references in official Microsoft documents about VS 2008 SP1 that I've seen. On 2/4/2008, Brian Keller said in a VSTS Forum Answer Re: When is Visual Studio 2008 SP1 coming out? post:

We haven't announced any dates around SP1. Once details become available we'll make them known but for now it's too early to say anything about the schedule.

The VS 2008 Web Development Hot-Fix Roll-Up Available that Scott Guthrie announced on February 8, 2008 isn't a service pack.

It's interesting that Microsoft is announcing a service pack for VS 2008 before the product is officially released.

Added: 2/21/2008

SQL Server Compact Edition 3.5 SP1 Beta for Entity Framework Beta 3 Is Available

Ambrish Mishra, Program Manager for SSCE, announced Download available for SQL Server Compact 3.5 SP1 Beta for ADO.Net Entity Framework Beta 3 on February 20. This is a special version (Build 3.5.5626) of SSCE SP1 Beta 1 specifically for EF Beta 3. This build is the same as that released with the current SQL Server 2008 CTP6. (See the SQL Server Compact Release Versions post of February 8, 2008 for build and release vehicles.)

Ambrish's post includes step by step instructions for creating a working Entity Data Model with the included Northwind.sdf database file.

You can download SSCE v3.5 SP1 Beta for EF Beta 3 here. Be sure to check out the ReadMe file before installing this SSCE Beta, which obviously is not fully cooked. There are 11 known issues, some of which seem to me to be serious deficiencies.

I remain curious as to why anyone would layer heavyweight EF components over a lightweight, single-user database like SSCE.

Added: 2/21/2008

Roger Alsing: LINQ to NPersist Is Progressing

Roger's More Linq support for NPersist post of February 20, 2008 describes his technique for adding LINQ support for Mats Helander's NPersist object/relational mapping tool by generating LINQ-like NPath instead of SQL queries. Mats welcomed Roger back to the NPersist project in his Roger Is Back post of January 9, 2008. NPersist is now at version 1.0.10; you can read more about it in this 200-page Inside NPersist manual (.doc format).

Here are links to Roger's earlier posts on the topic:

Download the current NPersist source code, binaries or both here.

Update 2/24/2008: Roger has LINQ to NPersist running with a Microsoft Access database because his development machine is dead, according to his Linq to NPersist to MS Access post.

Dave Longnecker Replaces Web Gallery 2.0's Custom n-Tier Data Layer with LINQ to SQL

The details are in Dave's WebGallery 2.0 #2 - HttpHandler and LINQ Data Model post of February 20, 2008. The post also includes some links to his earlier posts on LINQ:

Added: 2/21/2008

Richard Bushell: Use Timestamp Fields for Concurrency Conflict Management with the LinqDataSource Control

If you use LINQ to SQL's default value-based concurrency conflict management feature, the LinqDataSource control stores the original values in ViewState. In his The LinqDataSource and the Hidden Viewstate of 2/21/2008, Richard goes into detail about how value-based concurrency works and the value of replacing original values with a single timestamp column.

His earlier How to Update Data with LINQ-to-SQL post of February 18, delves into updating rows without bringing an entity instance into memory.

Added: 2/21/2008

Ruurd Boeke Continues His Postcompiling for Entity Framework Series

Ruurd's initial post about using PostSharp to add IPOCO interfaces to an Entity Data Model (see the "An Automatic IPOCO Implementation for Entity Framework" topic below) has turned into a Postcompiling for Entity Framework series. Here's his table of contents with current links:

Here's a link to Ruurd's Entity Framework Contrib (EFC) project on CodePlex.

Added: 2/21/2008

Julie Lerman to Present Two Entity Framework Sessions at Tech*Ed US Developer 2008

Julie's Entity Framework at TechEd post of February 19, 2008 announces that she'll present

  • Advanced Entity Framework: Entity Data Model in the Enterprise
  • .NET 3.5 Data Access Guidance

at TechEd 2008 US Developer in Orlando June 3 - 8, 2008.

Register before April 4, 2008 and save $200 off registration costs.

Don't miss her .NET Rocks! Entity Framework podcast next Tuesday, February 26.

Added: 2/20/2008

Beth Massi Demos LINQ to SQL Master/Child Forms with Stored Proc Updating

Beth's One-To-Many (Master-Detail) Forms with LINQ to SQL post of 2/19/2008 shows you how to create an Orders/OrderDetails master-detail form, save edits made with stored procedures to the entities, and eliminate associated entity and referential integrity conflict exceptions when deleting OrderDetails entities.

Beth doesn't use Northwind for the demo because she wants foreign key values to be NOT NULL and use timestamp columns for concurrency conflict management. Both good ideas, but easy to implement on a copy of Northwind.

Added: 2/19/2008

Frans Bouma Tackles Function Mapping and Local Methods in LINQ to LLBLGen Pro

Frans is closing in on his epic LINQ to LLBLGen Pro implementation in Developing Linq to LLBLGen Pro, part 13 of February 19, 2008. This episode deals with issues with invoking functions within LINQ queries that don't map to database functions.

All store-specific ADO.NET data providers must support a designated set of canonical functions defined for aggregate, bitwise, date and time, math, string and other operations. Functions invoked by members of a projection that aren't canonical functions will execute on the result set in memory but not if they're included in the query (for example, in the Where clause.)

Frans' post deals with the following specific issues:

  • Constants in the projection
  • In-memory methods/property calls in the projection
  • Mapping methods and properties as database constructs
  • Booleans in projections
  • Lambda-based function usage
  • Object creation inside projections
  • LINQ to SQL oddness

and is longer than most of my posts!

His next post, which he hopes will be the last will cover defining function mappings for RDBMSs other than SQL Server and adapting LINQ queries to use LLBLGen's prefetch paths feature.

Added: 2/19/2008

Jim Wooley Explores LINQ Queries Against Self-Joined Tables

Jim's Managing self-referencing tables with LINQ to SQL post of February 18, 2008, demonstrates how to query a table with a self-join that generates a data tree. He uses the Northwind Employees table whose ReportsTo column contains the EmployeeID of the person's boss.

Jim notes that you can't use LoadOptions to eager load the Employees set, because eager LoadOptions doesn't allow cycles (a.k.a., cyclic references.)

Added: 2/19/2008

Pablo Castro: Links and Link Expansion in ADO.NET Data Services

In his Related entries and feeds: links and link expansion post of February 18, 2008 Pablo requests input from the community on the Astoria team's approach to handling GET operations for associated entries in Atom graphs:

This write up briefly describes how we model associations between resources as Atom links and proposes a usage pattern of the atom:link element to support retrieving resource graphs in a single response. We're looking for feedback on the approach and also to get folks thinking about inlined content and whether it should be considered an extension to Atom.

Pablo refers to his earlier post, AtomPub support in the ADO.NET Data Services Framework of 2/13/2008 for background. I discussed this topic in my  Pablo Castro: ADO.NET Data Services and the Atom Publishing Protocol post of February 14, 2008, updated 2/16/2008 for Dare Obasanjo's posts on AtomPub extensions.

The two topics under consideration are:

1. Links for modeling associations between resources: Use the current link syntax:

<link rel="related" title="Customer" href="Orders(11077)/Customer"  type="application/atom+xml;type=entry" />
<link rel="related" title="Employee" href="Orders(11077)/Employee" type="application/atom+xml;type=entry" />
<link rel="related" title="Order_Details" href="Orders(11077)/Order_Details" type="application/atom+xml;type=feed" />
<link rel="related" title="Shipper" href="Orders(11077)/Shipper" type="application/atom+xml;type=entry" />

with the "starting" end of the association as the title. An alternative is a custom Atom attribute. I recommend minimizing the use of custom attributes. It would be helpful if developers using Entity Framework data sources would singularize EntityType names and End names of the 1 or 0...1 side of AssociationSets, as in the above example. Processing should retain the nouns' number.

2. Expanding links inline. Using the current $include constructs to indicate which associations to expand and include them as content within the <link> element seems appropriate to me.

Note: This may expand into an independent post after I do some additional investigation on the topic, as well as how ADO.NET Data Services fit into the Internet Service Bus that's implemented as a CTP by BizTalk Services.

Update 2/22/2008: Pablo's "Data Friction", spot-on post of February 20, 2008 cites and agrees with Jon Udell's Overcoming data friction article of the same date, which laments the need for Web screen scraping because the underlying databases aren't Web-accessible.

Ruurd Boeke: An Automatic IPOCO Implementation for Entity Framework

Ruurd's Introducing Entity Framework Contrib: Easy IPoco implementation V 0.1 of February 18, 2008 describes his Entity Framework Contrib (EFC) project on CodePlex. EFC implements the

  • IEntityWithChangeTracker
  • IEntityWithKey
  • IEntityWithRelationship

interfaces, which increase the Entity Framework's "persistence ignorance quotient" to IPOCO (Plain Old CLR Objects with Interfaces). Postsharp automatically generates and implements the three interfaces from a POCO class in IL when you build your project. However, the class must be decorated with a custom attribute.

The Postsharp folks ask:

Have you already implemented things like transaction management, logging, caching, or security? In each method, you had to write a same dozen of lines of code, right?

With PostSharp, you can encapsulate these aspects as custom attributes. You can make your own custom attributes that will really add new behaviors to your code! This is sometimes called aspect-oriented programming (AOP) or policy injection.

For more on persistence ignorance, see Danny Simmons' Persistence Ignorance: OK, I think I get it now post of June 2, 2007 and my Persistence Ignorance Is Bliss, but Is It Missing from the Entity Framework? of April 24, 2007.

LINQ to Opf3: An Implementation of LINQ for Chili Software's Opf3 O/RM

Christian Liensberger's Opf3 and LINQ support post of February 18, 2008 announces that Chili Software's Object Persistence Framework 3 (Opf3) now includes support for LINQ by adding the Chili.Opf3.Linq namespace.

Opf3 is a simple O/RM that offers a free Express Edition that maps up to eight tables to classes with a maximum of eight properties each. Opf3 supports most popular commercial and open-source databases that have ODBC or OLE DB drivers.

A single developer license with source code costs US$199; a site license is $699. A wizard plug-in that generates classes and enables customizing the autogenerated mapping is available for $99 and $349. Opf3/Wizard bundles are $249 (single) and $999 (site).

For comparison, LLBLGen Pro licenses range from €229 for a single license to €159 each for 20 or more, excluding VAT.

Charlie Calvert: LINQ Librarian

Charlie's LINQ Books post of February 17, 2008 lists published and forthcoming LINQ-related books in the following categories:

  • Books on LINQ (5 published)
  • Books that Feature LINQ (3 C#, 2 ASP)
  • Not Yet Published (8, including mine)
  • Books on the LINQ Beta (2)

The preceding lists don't include Programming the Microsoft® ADO.NET Entity Framework by David Sceppa (Microsoft Press, scheduled for 7/9/2008.