Saturday, April 12, 2008

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

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

Comparison of "DataStores in the Cloud" Started

My Comparing Google App Engine, Amazon SimpleDB and Microsoft SQL Server Data Services post of April 9, 2008 is the beginning of a full-length comparison of Amazon SimpleDB, SQL Server Data Services, and Google App Engine beta versions.

As of April 10, 2008, the introduction and Data Model sections are complete.

Update 4/12/2008: Security and authentication topics expanded and moved to the "API" section, "API" section updated with query syntax and API limitations.

Added: 4/10/2008, Updated 4/12/2008

Jeff Currier Explains How to Use the cURL Utility with SQL Server Data Services

According to its author, Daniel Stenberg:

cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

Jeff's cURL'ing up with SQL Server Data Services post of April 12, 2008 shows you how to use cURL at the command prompt to query an SSDS authority, as well as create containers and create, update and delete entities from file-based templates.

Added: 4/13/2008

Rick Strahl Encounters an Anomaly in LINQ to SQL Behavior with Object Tracking Disabled

Object tracking creates a very small performance hit, so it's a common practice to set DataContext.ObjectTrackingEnabled = false if you don't intend to update entities. However, you receive an "Object Reference not set to an instance of an object" exception if the entity has deferred loading associations. Eager loading is required in this case.

Rick's LINQ to SQL ObjectTrackingEnabled and Deferred Loading of Related Data of April 12, 2008 notes:

It turns out that this is a known issue that has been reported on Connect before.

and he goes on to quote Alex Turner's response to the Connect Bug report, which explains the reason for throwing the exception.

Added: 4/13/2008

Sahil Malik Writes a Windows Communication Foundation Tutorial

You need to know how to create WCF services and clients if you intend to try n-tier deployment of LINQ to SQL or the Entity Framework. Sahil's irreverent approach to his tutorials makes them more interesting (and informative) than the ordinary step-by-steps from MSDN and elsewhere.

He starts the series with four (count 'em, four) posts on April 12, 2008:

  • What is WCF? explains the basics of Service Oriented Architecture (SOA) and what makes WCF different from its Web service predecessors.
  • Writing the WCF Hello World App shows you how to create a WCF service class library, add a WCF service, and edit and implement the ServiceContract interface. Sahil also explains the mysteries of the App.config file (for a class library, yet!)
  • Writing your first WCF client demonstrates using dynamic proxy generation with metadata from the mex endpoint or metadata predistributed to the client in a DLL.
  • Host a WCF Service in IIS 7 & Windows 2008 - The right way shows you how to deploy a WCF service to IIS 7.0, a topic that Sahil says appears "nowhere else on the web." The process is by no means straightforward.

It will be interesting to see if more episodes follow.

Added: 4/13/2008

Beth Massi Starts LINQ to SQL N-Tier Smart Client Series

Beth's LINQ to SQL N-Tier Smart Client - Part 1 Building the Middle-Tier post of April 12, 2008 covers the following topics about the middle tier:

  • The Great Debate - DataSets or objects?
  • Going N-Tier with LINQ to SQL
  • Contract First
  • Disconnected Retrieval
  • Disconnected Updates and Deletes

Full VB 2008 code for the middle tier is included. Beth promises that her next post in the series "we'll build our client form and implement a simple technique for change tracking."

Added: April 12, 2008

Guy Burstein: Download the .NET 3.5 Enhancements Training Kit Preview

Guy's .NET 3.5 Enhancements Training Kit is available for Download says:

The Developer and Platform Evangelism Group in Microsoft has created a new training kit for all the enhancements for the .Net Framework 3.5:

  • ASP.NET Dynamic Data
  • ASP.NET AJAX History
  • ASP.NET Silverlight controls
  • ADO.NET Data Services
  • ADO.NET Entity Framework

Download the training kit (34.9 MB)

The April Content Preview contains Developer and Platform Evangelism Group's elementary Hands-on Labs for ADO.NET Entity Framework, ADO.NET Data Services, and ASP.NET Dynamic Data. Content for the Presentations, Demos, Screencasts, and Resources "will be added in a future release of the training kit.

Added: April 12, 2008

Upcoming Microsoft Developer Webcasts about LINQ and ADO.NET Data Services

From Scott Lum's MSDN Online Media Blog: Upcoming Microsoft Developer Webcasts: WCF, WF, Linq, AJAX, IIS 7.0, MS Sync Framework post:

MSDN Webcast: geekSpeak: Inside LINQ to XML with Paul Sheriff (Level 200)
In this episode of geekSpeak, Microsoft Regional Director Paul Sheriff explains how to put LINQ to XML to work in your applications. Guest Presenters: Paul Sheriff, President, PDSA, Inc. He has authored several books, webcasts, videos, and articles on the Microsoft .NET Framework, Microsoft SQL Server, and Windows SharePoint Services.
4/16/2008 12:00 PM - 1:00 PM Pacific Time | Duration: 60 Minutes

MSDN Webcast: LINQ Features in Visual Studio 2008 (Level 200)
Think you have heard all there is to know about Microsoft .NET Language-Integrated Query (LINQ)? Think again! In this webcast, we dazzle and amaze you with our staggering array of wondrous tools to make your LINQ experience a memorable one! Presenter:: Zain Naboulsi, Developer Evangelist, Microsoft CorporationTechnology is useless if it does not serve a clear purpose. That's Zain's philosophy. In fact, showing people how technology can make their lives better delivers his greatest on-the-job thrills
4/16/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

MSDN Webcast: Offline Data Synchronization with the Microsoft Sync Framework (Level 100)
In this webcast, we give an overview of the Microsoft Sync Framework and describe its key components that enable any data store to exchange information. We examine the built-in synchronization providers, Sync Services for ADO.NET, Sync Services for File Systems, and Sync Services for FeedSync, in addition to explaining how to implement custom synchronization providers for custom data sources. Lastly, we take a look at an example of using the Microsoft Sync Framework along with the new Microsoft SQL Server Data Services to provide synchronization capabilities across multiple applications, like Microsoft Office Access and Outlook. Presenter: Lindsay Rutter, Developer Evangelist.
4/17/2008 10:00 AM - 11:00 AM Pacific Time | Duration: 60 Minutes

Related Topic

MSDN Webcast: Database Features in Visual Studio 2008 (Level 200)
Like working with data? The Microsoft Visual Studio 2008 development system comes with many new and improved data tools. Who could say no to those cute little controls? Join this webcast for the ultimate database tools experience that you can have without a laser light show! Presenter: Zain Naboulsi, Developer Evangelist.
4/17/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

Added: April 12, 2008

Pratik Patel Describes the IUpdatable Interface for ADO.NET Data Services

The new IUpdatable interface supports create, update, and delete (CUD) operations on ADO.NET Data Services entities. Pratik's IUpdatable & ADO.NET Data Services Framework post of April 10, 2008 to the Astoria Team Blog describes the interface's following 10 methods:

  • CreateResource()
  • GetResource()
  • SetValue()
  • GetValue()
  • SetReference()
  • AddReferenceToCollection()
  • RemoveReferenceFromCollection()
  • DeleteResource()
  • SaveChanges()
  • ResolveResource()

Pratik promises "some examples and the sequence of calls made on the IUpdatable interface for each of them" in a follow-on post, as well as "features like ETag, Update interceptors" in later posts.

Added: April 10, 2008

White Paper: How to Choose a Data Synchronization Technology

Liam Cavanaugh's How to Choose a Data Synchronization Solution for Offline and Collaboration post of April 10, 2008 says the following about this Microsoft whitepaper about choosing between multiple sync technologies;

[W]e have posted a document titled "How to Choose a Data Synchronization Solution" which is an attempt to differentiate the offline and collaborations solutions available from Microsoft.  Hopefully this will help you better understand the various data sync technologies as well as to help answer the question of which technology is best suited for your particular needs.

Added: April 10, 2008

Rob Conery Starts a Series of MVC Storefront Tutorials

Rob describes his series as follows:

I'm creating an ongoing series of webcasts and blog posts, documenting the building of an eCommerce storefront using ASP.NET MVC. It's important to understand that this application has not been built yet - you're gonna help me do it :).

The goal is to build this application as openly, and "currently" as possible using an Agile approach with TDD. My goal is to post to this series at least twice a week as I build this application, taking your feedback and adjusting/discussing issues as they come up.

The project uses LINQ to SQL as its default data source, but Rob plans to plug in NHibernate and Subsonic later in the series.

Here are the episodes as of April 10, 2008:

So far, Rob has received plenty feedback on his "Agile approach with TDD" from TDD purists. His MVC Storefront: Intermission post of April 8, 2008 documents his reaction to the comments to the first two posts.

Added: April 10, 2008

Scott Guthrie: ASP.NET Dynamic Data Preview Available

Scott's ASP.NET Dynamic Data Preview Available post of April 10, 2008 includes the following description:

This new dynamic data preview now works with the standard built-in ASP.NET data controls (GridView, ListView, FormView, DetailsView, etc).  The dynamic data support enables these controls to automatically handle foreign-key relationships.  For example, on a gridview you'll now get automatic friendly name display of foreign key column values and automatic drop-down list selection support of these values when in edit mode.

The preview doesn't yet support Entity Framework. According to David Ebbo's day-earlier post of the same name:

Note that even though the drop has the ability to support Entity Framework (in addition to Linq To Sql), you will not quite be able to use it yet because it targets an Entity Framework build that is newer than the latest public build.  But don't worry, it won't be long before the missing pieces that will allow this are made available.

Added: April 10, 2008

Chris Rock Continues His LINQ to SQL Dynamic Queries Series

His LINQ TO SQL Dynamic Queries #3 (And's & Or's Together) post of April 10, 2008 extends his quest for dynamic Where clauses in LINQ to SQL expression. His previous two posts on this topic are:

LINQ TO SQL Dynamic Queries (And Operators)
LINQ TO SQL Dynamic Queries (Or Operators)

Added: April 10, 2008

Damien Guard Creates a Tiny Class to Enumerate Enums with LINQ

Damien's Using LINQ to foreach over an enum in C# post of April 10, 2008 describes a small Enums class to enable:

foreach(CustomerTypes customerType in Enums.Get<CustomerTypes>())



Calais.NET Abstracts RDF Metadata from HTML, XML and Plain Text Documents with LINQ to XML

Chris Fulstow, an ASP.NET developer in Sydney, has written a API wrapper for the Calais Web service "that abstracts away web service details like complex XML input parameters and verbose RDF output data by processing the data with LINQ to XML." Chris's Calais.NET - generating metadata using the Calais web service post of March 21, 2008 explains his open-source project, which is licensed under the Microsoft Reciprocal License (Ms-RL) and available for download from Codeplex.

You pass the URL for an HTML, XML or plain text document to the Calais.NET API wrapper and receive a IEnumerable<string> of Resource Description Format (Semantic Web) entities that the Calais Web service detects in the document. For the current list of entities that Calais claims to detect, go to Calais Semantic Metadata.

Calais, which is sponsored by Reuters, delivers a free Web service that has this lofty goal and components:

The Calais initiative seeks to help make all the worlds content more accessible, interoperable and valuable via the automated generation of rich semantic metadata, the incorporation of user defined metadata, the transportation of those metadata resources throughout the content ecosystem and the extension of it’s capabilities by user-contributed components.

The Calais initiative has three major components:

  • The Calais Web Service is the core. The Web service provides for the automated generation of rich semantic metadata in RDF format.
  • A series of sample applications to demonstrate how the web service can be utilized and serve as a starting point for other’s development activities.
  • Active support for developers that want to incorporate Calais capabilities in their applications and web sites.

The Calais initiative is sponsored by Reuters and built on ClearForest technology.

Calais was the primary topic of The semantic web: Start making sense story for The Economist's "Technology Monitor" column of April 9, 2008. The column also mentions a number of other startups whose business plans relate to extracting metadata from ordinary text

Added: April 10, 2008

Danny Simmons: Visual Studio 2008/.NET Framework 3.5 SP1 to be Entity Framework's Shipping Vehicle

Danny wouldn't provide a date, but advises in EF will ship with SP1 of VS 2008/.Net Framework 3.5 (April 9, 2008) that EF will ship in VS2008 SP1 "this summer" and that EF beta bits will be in the forthcoming VS 2008 SP1 beta.

Danny also says that he'll be at DevConnections in Orlando in a couple of weeks giving these two EF presentations:

VMD314: Entity Framework in the Real World
Daniel Simmons
Come see the Entity Framework in action! Check out an exciting new open source application built on the Entity Framework. During this session we’ll discuss and demo the use of the Entity Framework to build a LOB application in the healthcare vertical.

VDM215: Entity Framework: Application Patterns
Daniel Simmons
Microsoft is introducing the ADO.NET Entity Framework and the Entity Data Model to help developers code against first-class business objects when creating business applications. Like any new technology, most of the information available on the topic focuses on what the Entity Framework is, what are its constituting components and related aspects. This session takes the audience beyond the “what“ of the Entity Framework, instead delving into various application scenarios and approaches to application architecture to show how one can use the Entity Framework today. We shall discuss the role of Entity Framework in Web, rich-client, and service-oriented applications.

Ryan Dunn Posts First SQL Server Data Services Sample App Available to Download or Test

It might have a funky name but Ryan's PhluffyFotos Sample Available post of April 9, 2008 is the first of what I hope will be several sample applications that use SSDS as their data source. Following are highlights:

    • This sample has a LINQ-to-SSDS provider in it.  You will notice we don't use any strings for queries, but rather lambda expressions. I had a lot of fun writing the first version of this and I would expect that there are a few more revisions here to go. Of course, Matt Warren should get a ton of credit here for providing the base implementation.
    • This sample also uses a very simplistic ASP.NET Role provider for SSDS. Likely updates here will include encryption and hashing support.
    • We have a number of Powershell cmdlets included for managing authorities and containers.

You must have credentials for the SSDS limited beta to run the sample code. If you don't, here's a link to an online version.

Beth Massi Offers Link List for VS 2008 N-tier Application Resources

Beth has accumulated a feed of Resources for Building N-tier Applications (April 9, 2008), which includes N-Tier and Remote Applications with LINQ to SQL.

Liam Cavanagh Demonstrates FeedSync Between Machines with the Sync Framework

Using the Microsoft Sync Framework to upload data to SQL Server Data Services (SSDS) isn't a built-in feature yet, but the following sample project will give you a leg up when Sync becomes the favorite way of keeping offline data sources synchronized.

According to Liam's Synchronization of Browser Favorites using FeedSync and the Microsoft Sync Framework of April 8, 2008:

At first, creating a new provider and figuring out how to make it sync can be a little intimidating. In order to help you through the process, we will walk through the creation of a simple provider that can sync between directories that contain Favorites. We will start first with the metadata store that the provider will use, since considering how metadata will be stored is the first step a provider writer should take when writing a provider. On top of this, we will build the provider, which will provide our actual sync capability. Then, we will use this provider to produce and consume feeds so that we can share our favorites between computers.

Liam presented Sync to the Web - Enable Offline Access to Web Data from any Data Store, which covers the use of Sync Framework with SSDS, at MIX 08.

Pablo Castro wants Input for Batching ADO.NET Data Services Requests

Pablo's Batching Data Service Requests post of April 6, 2008 casts a net for suggestions from developers and data architects for the syntax of batched CRUD operations with Astoria.

Ryan Dunn Interviews SSDS Architects Istvan Cseri and Nigel Ellis for Channel9

The blurb for the Istvan Cseri and Nigel Ellis: SQL Server Data Services Architecture interview posted April 7, 2008 says:

SQL Server Technical Evangelist Ryan Dunn sits down and talks turkey with two of the creators of SQL Server Data Services (SSDS), Architect Istvan Cseri and Development Manager Nigel Ellis. Istvan and Nigel dig into how to design applications for SSDS and cover a number of the interesting aspects of working with SSDS in terms of features, design, and security.

If you're interested in working with SSDS, don't miss this video segment.

Debra Dove: Avoid SQL Server 2008 (Katmai) Connection Problems

If you're using a pre-release version of SQL Server 2008 (Katmai) you've probably performed the required patches. If not, read Debra's Connecting to Pre-Release Versions of SQL Server 2008 – Part Deux of April 7, 2008.

Note that neither LINQ to SQL or Entity Framework will support SQL Server 2008's GEOMETRY or GEOGRAPHY datatypes or SPARSE columns.

Paul Stovell Demonstrates SyncLINQ for Silverlight in a Live Application

Paul's SyncLINQ for Silverlight post of April 7, 2008 has an embedded Silverlight app that demos data binding with his open source SyncLINQ project.

Note that the entries you add don't persist.

Updated Version of "Rumor: Google to Compete with SimpleDB and SSDS with Bigtable as a Web Service"

My post about the Google App Engine, which undoubtedly will compete with SQL Server Data Services, has been extensively updated to cover it's release to limited beta status on Monday night, April 7, 2008.