Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Sunday, September 28, 2008

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

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

• Updated 9/28/2008 3:00 PM PDT adding VS 2008 SP1, jQuery, ASP.NET MVC 
• Updated 9/27/2008 2:00 PM PDT with EF, LINQ to SQL, LINQ to XML, SSDS
•• Updated 9/26/2008 8:00 AM PDT adding EF POCO update, Silverlight RC0, DD
• Updated 9/25/2008 12:00 noon PDT including newly announced PDC 2008 sessions

Entity Framework and Entity Data Model (EF/EDM)

••• Julie Lerman’s No, I do not want Set in the name of my EntitySet post of 9/26/2007 echoes my Forcing Gratuitious Pluralization of EF EntitySet Names Was a Very Bad Decision post of 9/20/2008. Both of us abhor the enforced Set suffix for singularized EntitySets.

Jarek Kowalski released v1.03 of his EF POCO Adapter which focuses on n-tier scenarios and detached entities, according to his EF POCO Adapter updated (v1.03) post of 9/25/2008. Following are Jarek’s descriptions of the changes:

  • Added wrapper for ObjectContext.ApplyPropertyChanges() to IEntitySet<T>
  • Added wrapper for ObjectContext.Detach() to IEntitySet<T>
  • Fixed handling of detached/out-of-scope entities w.r.t lazy loading and attaching to other contexts. Lazy loading outside of scope will do nothing if the context had DeferredLoadingEnabled=false, otherwise will throw.
  • Added partial OnZZZCreated() methods on generated contexts, adapters and proxies to enable integration with 3rd-party extensions
  • Fixed code generation from EDMX.
  • EFPocoContext.EnableLazyLoading has been renamed to EFPocoContext.DeferredLoadingEnabled to better align with Linq to SQL and our plans for EF v2
  • Fixed adapter-POCO synchronization for complex types

You can download the source code from the MSDN Code Gallery’s Persistence Ignorance (POCO) Adapter for Entity Framework section.

Jarek’s previous posts about the EF POCO Adapter:

• Frans Bouma is interviewed by .NET Rocks! podcasters Carl Franklin and Richard Campbell "about his thoughts on the ORM revolution, his products, and the Entity Framework” in show #380. Frans’ interview starts at 14:00.

Frans says Microsoft has “put LINQ to SQL on the back seat,” which corresponds with the points I raised in my Is the ADO.NET Team Abandoning LINQ to SQL? post of May 23, 2008 (updated 5/23/2008). Carl Franklin also brings up Microsoft’s original position was that “Entity Framework is not an O/RM” at about 37:00.

Julie Lerman’s lengthy “Data Access Options in Visual Studio 2008” article for CoDe Magazine became available online on 9/25/2008. It’s a must-read for developers who need to decide on one of the seven .NET 3.5 SP1 data access technologies her article describes.

Note: Non-subscribers can view Page 1 only until two months after publication.

Muhammad Mosa starts a new multi-part Entity Framework tutorial with Inheritance and Associations with Entity Framework Part 1 of 9/24/2008, which (paraphrasing Moses) covers building simple associations between two entities and writing custom code to retrieve other parts of the relation when inheritance is applied.

His detailed, downloadable sample project contains the following, fully illustrated (by screen captures) topics:

  • How to define a model with Table-per-Hierarchy Inheritance
  • Creating Sub Entities
  • Define Mappings
  • Define An Abstract Class

LINQ to SQL

••• Fredrik Kalseth’s DataContext Repository Pattern Example Code post of 9/27/2008 contains a link to download sample code for his Linq to Sql, Programming Against an Interface and the Repository Pattern of 5/5/2008 about which Fredrik says:

The magic that lets us run queries against for example IPage, is in the Cast<T> extension method in System.Linq. By using it, it allows clients to ask the Repository<T> method for IPage, which then through the mapping configured in the static TableMaps dictionary (where at application startup I've added the mapping between IPage and Page) gets translated into a request for the Page table from the context, and then finally cast back to a IQueryable<IPage> before being returned to the caller, ready for querying against.

His earlier, related The Specification Pattern and Encapsulation post of 7/12/2008 links to Nicholas Blumhardt’s Implementing the Specification Pattern via Linq post of 7/6/2008.

Matt Manela publishes a reader’s simpler method for SSCE 3.5 connection sharing in his SQL CE 3.5 with LINQ to SQL Revisited post of 9/26/2008. The original post was SQL CE 3.5 with LINQ to SQL of 9/8/2008. (Repeated in SQL Server Compact 3.5)

Simon Segal supplements the post below with LINQ To SQL - Going POCO and more……! Part 2 of 9/25/2008, which discusses accessor mutators for EntitySet and EntityRef types.

Simon Segal generates a multifile assembly of his LINQ to SQL libraries for his POCO Custom Multifile Assembly and ReSharper post of 9/24/2008. His earlier LINQ To SQL - Going POCO and more…..! post describes his

Generic Repository approach [that] utilises POCO’s along with Specifications and Fetching strategies (an nHibernate concept). …

The idea of the generic repository began as an extension of the ideas expressed by Mike Hadlow in his article here which are derived from Ayende’s work here.

Simon discusses the design of his POCO generic Repository in his lenghty POCO improves inheritance for LINQ to SQL post of 8/26/2008.

• Damien Guard has fixed a few bugs in his Text Template Transformation Toolkit (v.74) on 9/25/2008 and there’s a new, corresponding version of my DamienGuardT4.sln project available from SkyDrive. For more details, see Bidirectional Serialization of LINQ to SQL Object Graphs with Damien Guard’s T4 Template in VS 2008 SP1, which was updated on 9/25/2008 also.

Nick Berardi demonstrates How NOT To Optimize LINQ Statements in his post about LINQ to SQL queries of 9/24/2008. Nick looked at the T-SQL generated by his complex LINQ to SQL query, which included a couple of let statements, and concluded 34 lines with three CASE statements was too many. His optimization reduced the number of lines to 16, but increased the execution time by a factor of 4.6.

Nick says:

The moral of the story is you probably don’t need to optimize your SQL query through LINQ, just keep it simple and optimize your LINQ statement and leave the rest up to the professionals at Microsoft who created the LINQ to SQL expression query generator.

LINQ to Objects, LINQ to XML, et al.

• Charlie Calvert has returned to his LINQ Farm series. LINQ Farm: LINQ to XML and Line Numbers of 9/26/2008 shows how to indicate line numbers in XML Documents with help from an XmlLineNumbers project from XmlLineNumbers.zip in CodeGallery’s LINQ Farm section.

Rinat Abdullin compares the performance of simple LINQ to Objects queries and hard-coded equivalents in his Some performance issues and caveats of LINQ of 9/25/2008.

ADO.NET Data Services (Astoria)

•••• Scott Hanselman offers a demonstration of jQuery 1.2.6 in conjunction with

  • ADO.NET Data Services and it's JavaScript Client Library
  • ASP.NET AJAX
  • ASP.NET AJAX Client Templating (Preview)

in his jQuery to ship with ASP.NET MVC and Visual Studio post of 9/28/2008. For more on Microsoft’s adoption of jQuery in VS 2008, see the Miscellaneous topic.

• Shawn Wildermuth reports about encountering performance problems in his online Silverlight 2 samples in his ADO.NET Data Services Performance Issues post of 9/25/2008.

The problem occurs with an Astoria query that retrieves many:one EntityRefs (Category and Supplier for each Product requested). Part of the problem might be that Shawn included the Category.Picture bitmap field in the query. LINQ to SQL, which is smart enough not to repeat T-SQL requests for objects currently in memory, doesn’t provide updatable Astoria objects out of the box. Entity Framework doesn’t support LINQ to SQL’s DRY (don’t repeat yourself) feature.

Steve Maine will present Microsoft .NET Framework: Developing RESTful Services at PDC 2008:

Learn the latest features in Windows Communication Foundation for building Web 2.0-style services that use URIs, HTTP GET, and other data formats beyond XML. See how these features can be applied to AJAX web sites, "REST" applications, and data feeds.

ASP.NET Dynamic Data (DD)

•• DLPanther announces plans for a series of articles about ASP.NET Dynamic Data in his ASP.NET Dynamic Data, The Next Data Revolution! post of 9/25/2008.

Steve Naughton continues his exploration of new DD techniques with Dynamic Data Custom Pages with Ajax Control Toolkit Tabs of 9/25/2008, which describes the two most successful methods he found for creating a generic page with a DetailsView that shows the parent record and a set of tabs showing all its child records.

Stephen Walther will deliver ASP.NET Futures: WebForms and MVC Advancements at PDC 2008:

Learn about future advances in ASP.NET like WebForms, MVC, AJAX, Dynamic Data, and dynamic languages.

Scott Hunter will present ASP.NET: Dynamic Data 2.0 and Dynamic Data for MVC at PDC 2008:

The next version of ASP.NET MVC contains a new scaffolding feature based on Dynamic Data that provides a rich framework for creating data driven web sites. Learn how to quickly build a Dynamic Data web site using features like model level validation, field and entity templates, and scaffolding.

Mike Taulty reports about experiments with DD in his ASP.NET 3.5 Sp1 Dynamic Data post of 9/24/2008. He was surpised to find that VS 2008 SP1’s DD templates were limited to Dynamic Data Web Site (Entity Data Model data source) and Dynamic Data Entities Web Site (LINQ to SQL data source).

Steve Naughton updated An Advanced FieldTemplate with a GridView/DetailsView Project, the seventh episode of his Dynamic Data and Field Templates series, on 9/23/2008. Paraphrasing the updates:

The FieldTemplate now has ParentDetails and the ChildrenGrid FieldTemplate’s
ParentDetails no longer support Insert but they do support Update as before.

SQL Server Data Services (SSDS)

Kim Cameron and Stuart Kwan will present Claims-Based Identity: A Security Model for Connected Applications at PDC 2008:

Claims-based security is the underpinning of many applications, services, and servers. This model enables security features like: multiple authentication types, stronger authentication on-the-fly, and delegation of user identity between applications. Learn how to use this model in .NET, how it integrates with Active Directory, how it works across platforms, how it works with existing applications, and how we use it at Microsoft.

SSDS v1 will use claims-based security from BizTalk Services.

Lynn Ayres and Tore Sundelin will deliver Connecting Active Directory to Microsoft Cloud Services at PDC 2008:

Learn how to augment your existing IT infrastructure with Microsoft Services. Manage and secure end user access to cloud services using your existing investment in Active Directory. Enable end users to access cloud services through existing Active Directory accounts, the same way they access your intranet-hosted software today. Hear how to enable existing software to use new service capabilities without re-writes, and do it all through the use of open and standard protocols.

Gianpaolo Carrero’s Cloud Services Architecture symposium post of 9/24/2008 describes the Head in the Cloud, Feet on the Ground symposium on PDC 2008’s day four. Gianpaolo says:

We will explore a few examples of cloud-based infrastructure usage as part of an existing application, we will discuss the architectural tradeoffs as well as best practices resulting from that usage. We will also walk through detailed examples of ‘enterprise grade’ hosted application design. And finally we will go through emerging patterns that take into account the physical aspects of a cloud-based application that are often overlooked, such as bandwidth which happens to be not infinite and certainly not free at high scale.

David Robinson announced in his SSDS and SSIS…like peanut butter and jelly post of 9/23/2008 that Matt Masson has posted documentation and downloadable code for SQL Server Data Services Connectors for Integration Services on CodePlex. Here are the download links:

The Source and Destination adapters simplify downloading and uploading SSDS data by taking advantage of SQL Server Integration Services.

Roger Jennings explores two relational databases in the cloud in his SSDS’s Competitors: Oracle 11g and Sun MySQL on Amazon EC2 of 9/23/2008. Oracle 11g for the Cloud was announced by Amazon Web Services on 9/22/2008; cloud-based MySQL was announced (originally) on 5/8/2008 and didn’t appear to garner much interest.

The unadvertised special is a a shared AMI for Oracle Express 10g with Oracle Enterprise Linux available from Amazon.

More from ZDNet about the cloud in Sam Diaz’s Intel at Oracle OpenWorld: It’s about time - and the cloud post of 9/24/2008 from Oracle OpenWorld.

Ayende Rahien’s Amazon EC2 now offers RDBMS post of 9/23/2008 gives his take on the difference between Oracle and MySQL in the cloud. Ayende concludes “I found this to be extremely interesting.”

Andrew Whitten says the following about his 9/21/2008 post about the Pictures in the Cloud - SSDS demo app, available from CodePlex:

I’ve been having a bit of hack around to show how pictures can be stored by this kind of service. There isn’t any reason to use this over the other online photo sharing sites, but it demonstrates how to use the API.

SQL Server Compact (SSCE) 3.5 and Sync Services

Matt Manela publishes a reader’s simpler method for SSCE 3.5 connection sharing in his SQL CE 3.5 with LINQ to SQL Revisited post of 9/26/2008. The original post was SQL CE 3.5 with LINQ to SQL of 9/8/2008. (Repeated in LINQ to SQL)

Visual Studio 2008 Service Pack 1 (General)

•••• MSDN Events Summer 2008 Resources offers the following downloads for Session 3 | Developing Applications with Visual Studio 2008 and .NET Framework 3.5 Service Pack 1:

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

•••• Scott Guthrie announces support for the jQuery JavaScript library in the ASP.NET MVC preview and future versions of VS 2008 in his jQuery and Microsoft post of 9/28/2008. Scott says:

We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch.  The files will continue to use and ship under the existing jQuery MIT license.

We will also distribute intellisense-annotated versions that provide great Visual Studio intellisense and help-integration at design-time. …

The jQuery intellisense annotation support will be available as a free web-download in a few weeks (and will work great with VS 2008 SP1 and the free Visual Web Developer 2008 Express SP1).  The new ASP.NET MVC download will also distribute it, and add the jQuery library by default to all new projects.

We will also extend Microsoft product support to jQuery beginning later this year, which will enable developers and enterprises to call and open jQuery support cases 24x7 with Microsoft PSS.

jQuery’s John Resig has more to say about Visual Studio’s adoption of jQuery in his jQuery, Microsoft, and Nokia post of the same date.

As Ayende Rahien points out in his On jQuery & Microsoft post of 9/28/2008: “[S]omething else that I didn't see other people pointing out":

This is the first time in a long time that I have seen Microsoft incorporating an Open Source project into their product line.

I am both thrilled and shocked.

Justin Etheredge’s $("Microsoft").append("excitement"); post of 9/28/2008 goes into much more detail about the impact of inclusion of third-party, open-source jQuery in VS 2008.

Rick Strahl announces the first of a two-part series of jQuery articles in his Introduction to jQuery Article posted post of 9/28/2008. Rick says the in the latter post:

Part 1 of the article is mostly a pure jQuery introduction and doesn’t talk about jQuery’s Ajax features or direct interaction with the server side and ASP.NET. Rather it focuses purely on many of the extremely useful client side features as well as the basic concepts of extending jQuery with plugins.

Part 2 then will talk about the server side integration with ASP.NET using various mechanisms to call ASP.NET content from raw page Ajax calls, to JSON Service callbacks, to using templating and even partial rendering against server side ASP.NET application. I’ll also talk about building ASP.NET components that integrate with jQuery. This article is based on my jQuery session that I’ve been giving at various conferences and user groups.

•••• Justin Etheredge provides a flow diagram for MVC requests in his ASP.NET MVC Request Flow post of 9/27/2008. Justin says he was unable to find a similar diagram on the web.

Scott Guthrie announced the release of Silverlight 2 RC0 for developers in his Silverlight 2 Release Candidate Now Available post of 9/25/2008. Scott says:

You can download today's Silverlight Release Candidate and accompanying VS and Blend support for it here.  Note that Expression Blend support for Silverlight 2 is now provided using Blend 2.0 SP1.  You will need to install Blend 2.0 before applying the SP1 service pack that adds Silverlight 2 support.  If you don't already have Blend 2.0 installed you can download a free trial of it here. …

Over the next few months we will be releasing a lot of new Silverlight 2 controls (more details on these soon). Today's release candidate includes three new core controls - ComboBox, ProgressBar, and PasswordBox - that we are adding directly to the core Silverlight runtime download (which is still only 4.6MB in size, and only takes a few seconds to install):

He also says the final release will be “shipped … soon.” Get more details on the release from:

Beth Massi offers a link to the source code and slides for her Data Sources and Data Binding in WPF Talk in Redmond on 9/22/2008. Beth says:

I started the talk with basics of data binding to a variety of data sources and then we moved to more to data access discussions and n-tier architecture issues. It was similar to the talk I did at Bay.NET in SF last month but I focused this time completely on WPF and didn't show any Winforms at all. This allowed us to have more time for architecture discussions and I think it worked out well.

Ayende Rahien is in the process of learning Erlang, the open-source programming language behind Amazon SimpleDB and open-source CouchDB, a document-oriented database that’s an Apache Incubator project.

Here are his posts by topic as of 10/24/2008 11:00 AM PDT (in chronological order):

All in all, an amazing tour de force of analyzing complex source code in a language that’s new to him.

Sunday, August 31, 2008

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

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

Update 8/30/2008 to 9/1/2008: Additions and updates
Update 8/29/2008: Additions
Update 8/28/2008: Additions
• Update 8/27/2008: Additions
Update 8/26/2008: SSDS is back on line as of 13:30 PDT

Entity Framework (EF)

•••• Julie Lerman’s EF Business Classes in ASP.NET Apps - Don't pass that query around! post of 8/31/2008 recommends that developers using EF

Return Results, not Queries from the Business classes

by forcing iteration by invoking the ToList(), FirstOrDefault() or similar method, or looping through a foreach structure.

•••• Shawn Wildermuth dispels The Fable of the Perfect ORM on 8/30/2008. He points out that at least the following factors enter into the selection of the object-relational mapping tool:

  • Functional Requirements
  • System Requirements
  • Skill-set of the Development Team
  • Business Factors
  • Time-to-Market
  • Business Culture
  • Lifetime of Project
  • Volatility of Schema

Shawn goes on to give examples of criteria for using LINQ to SQL, NHibernate, LLBLGen Pro, or Entity Framework.

•••• Julie Lerman’s More on Foreign Keys in EF post of 8/30/2008 describes a partial class to return the scalar value of a foreign key from an EntityReference. Foreign key values are useful for specifying associations with dropdown lists. (LINQ to SQL delivers foreign key values by default.)

•••• Matthieu Mezil demonstrates in his EF and WPF post of 8/29/2008 part of the code required for a WPF master-details application that enables using a combo box to choose the master for the details window.

••• Julie Lerman finds EntityKeys are case sensitive in her 8/29/2008 post. Improperly cased keys and property names return

  • The member with identity 'NWentities' does not exist in the metadata collection.
    Parameter name: 'identity'
  • The required entry 'customerID' was not found in the provided input. This entry is required by the key fields defined on type 'NWModel.Customer'

exceptions, respectively.

••• Matthieu Mezil strikes again on the table-per-hierarchy inheritance model in TPH Is Not NULL mapped on a relationship of 8/29/2008.

MaĆ­ra Wenzel's Handling Null Database Values Using Data Source Controls tip of 8/28/2008 notes that:

This topic Handling Null Database Values Using Data Source Controls has now been updated on MSDN to fix the sample based on various customer feedback. You can still see the old version here, in case you're curious to compare both versions.

Her post provides the details on what changed.

•• Matthieu Mezil continues his investigation of strangenesses in EF’s processing of a simple query in his LINQ To Entities: stranger and stranger post of 8/28/2008.

Jacob Proffitt’s Changing Table Names in an OR/M post of 8/27/2008 explains how to change EF and LINQ to SQL table names to suit a particular naming convention in both O/RMs’ XML mapping files. Jacob finds changing table names in EF is more difficult than LINQ to SQL.

•• Tim Mallalieu partially answered my Availability of Minutes of First "Advisory Committee" Meeting? question on 8/27/2008 in the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum:

We will put something out which will be a recap of the findings.

We we still need to do the final post mortem internally and then publish.

It’s the timetable that’s missing.

ADO.NET Data Services (Astoria)

•••• Shawn Wildermuth’s My ADO.NET Data Services/Silverlight 2 Article on MSDN Magazine post of 8/31/2008 points to his “Create Data-Centric Web Applications With Silverlight 2” article for the “Data Services” section of MSDN Magazine’s September 2008 issue. Shawn says:

What is cool about this approach is that you can issue LINQ queries on the client (in Silverlight 2) that will communicate with Data Services via the REST interface and execute queries and update data on the server.  The substantial difference that you will have to get used to is the use of Asynchronous LINQ queries in Silverlight 2.  Check out the article for all the details.

Marcelo Lopez Ruiz adds his two-cents to the Astoria history book with his ADO.NET Data Services History of 8/28/2009.

Vardi posted his Data Service Viewer 1.0 WinForm source code to CodePlex on 8/27/2008. Vardi says:

ADO.NET Data Services Tool help[s] you to create the query URL and view the result.

Marcelo Lopez Ruiz points out that “DateTimeOffset and Time properties are not available as CLR types in ADO.NET Data Services” in his Gotcha with EDM types in ADO.NET Data Services post of 8/27/2008.

Marcelo Lopez Ruiz continues with the reasons to use EF as Astoria’s back end in his timed Another ADO.NET Data Service metadata tip post of August 26. (Marcelo is on a one-week vacation.)

SQL Server Data Services (SSDS)

•••• Roger Jennings recommended that SSDS and Other Windows Cloud Services Should Have Their Own Blogs on 8/30/2008, seconding Ayende Rahien’s proposal of the day before.

Niraj Nagrani, Soumitra Sengupta, and David Robinson deliver A Candid Look at SQL Server Data Services and the Business Scenarios it Addresses in an 8/28/2008 interview by Greg Hughes. The trio tackles the following topics:

  • SSDS isn’t a hosted instance of SQL Server in the cloud, it’s an Internet-based data utility powered by SQL Server
  • Target market is businesses who offer Sofware as a Service (SaaS) applications, including small and medium-sized businesses, with multi-tenancy as an important feature
  • Integration of authentication with the BizTalk Services Identity Provider will be rolled out in the “very near future.”
  • Symmetry with on-premises instances will be outside-in rather than inside-out.
  • SSDS have the capability to hand on-premises data to SQL Server Integration Services (SSIS) and pump it up to the cloud or vice-versa.
  • Microsoft Sync Services will make SSDS into a “data hub.”
  • SQL Server Reporting Services and Analysis Services will be used to deliver reports on uptime, performance and the like.
  • SSDS will grow to 5,000 nodes next year.
  • Open beta will occur shortly after PDC 2008 and SSDS will go live in the first half of 2008.
  • SSDS will be the preferred store of compliance data for large businesses.

•••• Dave Robinson says in SSDS Tech-Ed Online Video Posted of 8/29/2008 that the interview was conducted at Tech•Ed North America 2008, which was held in early June, so the “very near future” appears not so near after all.

•• Soumitra Sengupta discusses Jon Udell’s “continuum of access styles” as it applies to SSDS in his Jon Udell cURL's with SQL Server Data Services post of 8/27/2008.

I’m not sure if just REST and SOAP as wire formats for queries constitute a “continuum,” but supporting AtomPub, JSON, and POX as wire formats as promised might qualify.

Jon Udell’s The continuum of access styles in the emerging Microsoft cloud post of 8/27/2008 mentions his ability to use cURL for basic SSDS navigation with the REST query protocol. Jon concludes:

Microsoft platforms have not historically encompassed the continuum of access styles. Happily, the emerging cloud does. And while the novelty of “just coding to a URL” on a Microsoft platform will undoubtedly attract some tirekickers who otherwise wouldn’t show up, the real draw will be the ability to exercise choice along the whole continuum.

That choice, by the way, is not only relevant to developers accessing hosted, web-facing services. It will matter as much — and with the SOAP option, even more — to developers accessing on-premises services behind the corporate firewall and across corporate boundaries. Facing outward or inward, you’re most productive when you can choose the right access style for the job at hand. Between the realm of the 100% Microsoft coder and the 0% Microsoft coder, a wide and fruitful middle ground is opening up.

Ryan Dunn complements Eugenio Pace’s Concurrency in SSDS post of 8/1/2008 for the SOAP protocol with Concurrency with SSDS via REST of 8/26/2008.

•• Mike Amundsen recounts his problems during the outage in the SSDS is unavailable for all beta users? (2008-08-26 06:00 PDT) [Resolved] thread in the SQL Server Data Services (SSDS) - Getting Started forum.

Roger Jennings’ SQL Server Data Services Beta Encounters First Major Unscheduled Downtime post describes the approximately 7.5 hour unscheduled outage that occurred on August 26, 2008. From the post:

The SSDS team is to be commended for keeping testers up to date on the progress of bringing the service back up. Their response contrasted with Amazon’s failure to alert customers of their February outage, as reported in Amazon Web Services Outage: Causes And Remedies of 2/16/2008.

•• The preceding post has been updated for subsequent events and blog posts and was moved to a separate post due to its increasing length.

Gianpaolo Carraro’s Multi Tenant Data Access (MTDA) Blueprint post of August 25, 2008 announces the availability of the MDTA Blueprint on CodePlex and a Channel 9 interview with Eugenio Pace, the developer. Here’s part of the description:

The Multi Tenant Data Access (MTDA) Blueprint, part of the Software-plus-Services Blueprint program, provides guidance on writing a SQL Server based, single instance, multi-tenant data access layer similar to that used in LitwareHR sample application (SQL Server version).

You need the S+S Blueprints Manager from CodePlex to install the MTDA blueprint. (I was unable to use it with my installation of VS 2008 SP1.)

Note: This blueprint doesn’t use SSDS, as far as I can determine so far.

ASP.NET Dynamic Data (DD)

•• Matt Berseth goes hog wild with home-page menu customization in his A Dynamic Menu For Your Dynamic Data post of 8/27/2008. Matt says:

I have my tables organized into 4 categories: Sales, People, Products and Reports.  And the cool thing is that this menu is completely dynamic.  You can add, remove or reorganize the categories without touching the UI.  And depending where you are keeping your metadata you could even do this without recompiling your app.  The grouping is automatically discovered from the metadata and the menu is built solely off the it so everything 'just works'.

Besides adding the grouping information, I also tagged each of my tables with a custom description that I am displaying under the grids title.  Nothing too complicated, but still interesting.

LINQ to SQL

•••• Damien Guard’s T4 template update for LINQ to SQL in his original post of 8/29/2008 was premature. The latest version will add:

  • Inheritance support
  • VB.NET generation
  • DataContract serialization

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

An updated link in future issue of this post will be provided when the template is fully cooked.

Rob Conery’s Working With Linq's Expression Trees Visually post of 8/29/2008 shows you how to extract and install the Expression Tree Viewer add-in from the CSharpSamples.zip file and use it to view LINQ to SQL expression trees.

•• See Jacob Proffitt’s Changing Table Names in an OR/M post of 8/27/2008 in the “Entity Framework” section.

Simon Segal explains how POCO improves inheritance for LINQ to SQL in his lengthy post of 8/26/2008. He promises:

I will shortly be posting a framework that makes working in a POCO and DDD style much simpler. The Framework includes implemented Specification Patterns, Fetching Strategies and Extensible Repositories for your LINQ To SQL pleasure.

Jeff Atwood recommends adding the NOLOCK statement to SELECT queries to solve a mysterious deadlock problem with LINQ to SQL in his Deadlocked! post of 8/25/2008.

Jonas Stawski recommends being extra-careful when Recreating Entities with Linq To SQL in his 8/25/2008 post.

LinqMaster uncovers an arcane bug with insert triggers and provides a workaround in LINQ to SQL Database Trigger Bug – Workaround of 9/25/2008.

Rico Mariani answers questions by readers of his LINQ to SQL performance analysis series in Linq Compiled Queries Q&A of 9/25/2008.

LINQ to Objects, XML, et al.

••• Bart De Smet goes into excruciatingly detailed coverage of the use of SOS (a.k.a. “Son on Strike”) with dynamic expression trees in his lavishly illustrated To Bind or Not To Bind – Dynamic Expression Trees – Intermezzo: SOS in Visual Studio. Bart says:

In this post I want to point out that you can actually live without that visualizer and go the hard-core way using SOS, … the WinDbg extension for managed code debugging that ships with the .NET Framework (sos.dll). A little-known fact is that SOS can be loaded directly in Visual Studio through the Immediate Window.

•• Martin Hinshelwood says LINQ to XSD is “Absolutely brilliant” in his LINQ to XSD post of 8/28/2008. I’d say the LINQ to XML team would be “absolutely brilliant” if they posted a LINQ to XSD release version instead of Alpha 0.2.

• Bart De Smet’s second post of 8/27/2008, To Bind or Not To Bind – Dynamic Expression Trees – Part 2, delves into IL generation, expression compilation, and emitting code .

Bart De Smet continues his dissertation on dynamic expression trees with To Bind or Not To Bind – Dynamic Expression Trees – Part 1 of 8/27/2008 by creating a DynamicExpression abstract class with MethodCallDynamicExpression, LambdaDynamicExpression and ParameterDynamicExpression factory classes.

Jared Parsons uses a LINQ to XML-powered word-wheel application to demonstrate how to “Increase LINQ Query Performance” in his “Basic Instincts” column for MSDN Magazine’s August 2008 issue.

Ira’s LINQ Distinct, a DataTable and the IEqualityComparer<T> post of 8/26/2008 describes how to write a custom IEqualityComparer<DataRow> for LINQ to DataSet to enable the Distinct() operator to operate on entire rows instead of a single designated column.

Bart De Smet’s To Bind or Not To Bind – Dynamic Expression Trees – Part 0 post of 8/26/2008 is the start of a new series about building dynamic expression trees.

SQL Server Compact (SSCE) 3.5 and Sync Services

No SSCE/Sync Services posts to date.

Visual Studio 2008 Service Pack 1 (General)

• Mike Taulty’s Final .NET Client Profile ( 3 ) post of 8/26/2008 points to his WPF, ClickOnce and the .NET Client Profile Channel9 video of the same date with this description:

A simple demo of building a "Hello World" application with Visual Studio 2008 Service Pack 1 and then deploying it via ClickOnce to a clean Windows XP machine using the .NET Client Profile rather than the full .NET Framework.

Mike Taulty’s The .NET Client Profile post of 8/26/2008 and The .NET Client Profile ( 2 ) of 8/27/2008 cast a jaudiced eye on the process of installing .NET 3.5 SP 1 on client computers with ClickOnce. Mike says:

If you're building something like a .NET WPF client application then one of the major bugbears (for both you and for Microsoft - let's be honest here :-)) is trying to get the .NET Framework on to the client machine.

We're trying to make this easier but if you were to look at the recent .NET Framework packages you'd perhaps not be able to tell that :-)

Miscellaneous (WPF, WCF, Silverlight, etc.)

•••• Phil Haack announces ASP.NET MVC CodePlex Preview 5 Released on 8/29/2008 and says the next release will be the official beta version. The post contains links to other important MVC-related articles.

• Roger Jennings reports problems with Internet Explorer 8 Beta 2’s new Web Slices feature in Fail on First Try of Internet Explorer 8 Beta 2 Web Slices of 8/29/2008. •••• Updated

•• Roger Jennings takes Jaiku’s new Google App Engine implementation to task in Jaiku + Google App Engine = Fail of 8/28/2008. The malformed home page shown in the post, which has lost its CSS content, took over a minute to load.

•• Aaron Skonnard posted Endpoint Screencasts - Hosting WCF Services in IIS to Channel 9 on 8/28/2008:

In this short video, CSD MVP Aaron Skonnard from PluralSight guides the viewer through how to host your WCF Service in IIS. We will start with the simple WCF service that we created in the first screencast, hosting it as an ASP.NET svc file. Aaron then demonstrates adding a couple endpoints (for greater detail, see the screencast on creating WCF endpoints) and accessing the service. Once we have our WCF service hosted in ASP.NET, we add it as an application to IIS for consumption.

The IE Team posted IE 8 Beta 2 for download on 8/27/2008. I installed it to try Web Slices on LINQ and Entity Framework Posts for M/D/YYYY+. The first item in this category recounts my lack of success with implementing Web Slices.

John Papa’s Great Fiddler Tip For Localhost Testing post of 9/26/2008 describes Shawn Wildermuth’s solution to getting Fiddler 2 to recognize the Cassini Web server’s localhost:port number: Prefix the port number with a period.

WebSlice Content for Internet Explorer 8 Beta 2

OakLeaf LINQ and Entity Framework Links

Last Updated: 8/31/2008 2:20 PM PDT

  • Entity Framework Additions
  • SQL Server Data Services Additions/Updates
  • ASP.NET Dynamic Data Additions
  • LINQ to SQL Additions
  • LINQ to Objects, XML, etc. Additions
  • Miscellaneous Additions
    • ASP.NET MVC Preview 5 Released to CodePlex
    • Problems with IE8B2's Web Slices Feature

Monday, July 28, 2008

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

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

Updated SQL Server Data Services (SSDS) Test Harness: Northwind REST and SOAP Uploads

The SSDSNwindEntitiesCS.sln sample project for my “Test-Drive SQL Server Data Services” cover article for the July 2008 issue of Visual Studio Magazine has been updated to SSDS Sprint 3, adds a couple of features, and has a few start-up bugs excised.

New Features:

  • The program attempts to create an authority if you haven’t added one.
  • A splash screen opens during the initial query for ACE container and entity object because the process is very slow with a moderate number of objects.

Updates:

  • The new 'application/x-ssds+xml' MIME type replaces ‘application/xml’.
  • The containerUri = response.Headers[HttpResponseHeader.Location]; instruction which now returns null has been replaced with concatenated constants as the containerUri value. This eliminates a problem when creating new containers with REST operations.

Download: You can download the SSDSNwindEntitiesCS project here (114-KB SSDSNwindEntities.zip file at Skydrive).

My Updated SQL Server Data Services (SSDS) Test Harness: Northwind REST and SOAP Uploads of July 27, 2008 has more details and screen captures.

Added: July 28, 2008

Stephen Forte’s Impedance Mismatch Post Elicits Responses from Domain-Driven Designers

The “Stephen Forte Embraces the Impedance Mismatch” topic of my LINQ and Entity Framework Posts for 7/14/2008+ post quotes Steve’s Impedance Mismatch post of June 27, 2008, which eschewed “object-fist” in favor of “data-first” design.

I assumed that Steve’s post would brew a storm of controversy, especially since he’s a member of the Entity Framework’s new Advisory Council. However, it turned out to be a tempest in a teapot as described in my Stephen Forte’s Impedance Mismatch Post Elicits Responses from Domain-Driven Designers of July 27, 2008.

Bidirectional Serialization of LINQ to SQL Object Graphs with Damien Guard’s T4 Template in VS 2008 SP1

LINQ to SQL developer Damien Guard, who joined the DPG in May 2008, announced the availability of a customizable T4 template to generate LINQ to SQL classes from the *.dbml file in his LINQ to SQL T4 template reloaded post of July 23, 2008.

A couple of minor modifications to the L2ST4.tt template file and addition of a reference to and using directive for the System.Runtime.Serialization namespace enables full-object-graph serialization of LINQ to SQL entities. This brings parity to both VS 2008 OR/M tools in the serialization department.

Read more at Bidirectional Serialization of LINQ to SQL Object Graphs with Damien Guard’s T4 Template in VS 2008 SP1 of July 24, 2008 (updated 7/27/2008) and download the sample C# project.

Mike Taulty Posts Five ADO.NET Data Services Screencasts

Following are titles with links to the five Astoria screencasts that Mike posted on July 25, 2008:

Ryan Dunn Makes IE Display SQL Server Data Services New application/x-ssds+xml MIME Type

Internet Explorer now prompts you to download SQL Server Data Services (SSDS) content that uses the new (post-Sprint 3) application/x-ssds+xml MIME type instead of application/xml.

Ryan’s Rendering POX for SSDS in Internet Explorer post of July 25, 2008 gives you the magic Registry hack to make IE display SSDS’s POX wire format.

Matthieu Mezil Shows You How to Instantiate a New EntityKey

Entity Framework uses EntityKeys to represent unique entities in its cache. EntityKeys are immutable, so Matthieu shows you how to instantiate new ones in his EntityReference change key post of July 25, 2008.

Phani Raju Demonstrates Using the AJAX 4.0 Preview’s DataView Control with ADO.NET Data Services

Phani’s ASP.NET AJAX 4.0 Master-Details View with the DataView and ASP.NET AJAX 4.0 Master-Details View with the DataView , Part 2 posts of July 24 and 25, 2008 use the ASP.NET AJAX 4.0 CodePlex Preview 1’s templating engine and DataView control to build master-details pages.

Phani uses Astoria and its AJAX Client Library for ADO.NET Data Services from CodePlex as the data source.

Jim Wooley: Quickly create an IEnumerable<T> from a DataReader

Jim’s Filling an object from a DataReader with LINQ using DataContext.Translate post of July 25, 2008 shows you how to use the DataContext.Translate<T>() method to create an entity set from a database table without mapping for the DataContext.GetTable() method.

Eric White Analyzes Responses to his “Are Developers Using LINQ?” Post

Eric received many detailed responses to his Are Developers Using LINQ? post of July 23, 2008. In his Are Developers Using LINQ? (Part 2) post of July 25, 2008, he describes these four common LINQ usage scenarios:

  • Using LINQ to Objects and LINQ to XML … .
  • Using query expressions … to access objects and XML.
  • Using LINQ to SQL or LINQ to Entities to access a database.
  • Using LINQ implemented using an IQueryable provider to something other than a SQL database.

and noted that there were only a few negative responses.

Keith J. Farmer points out in a comment to the first post that folks still call LINQ “link,” consider LINQ to SQL to be the only implementation, and believe SQL Server is the only LINQ-enabled data provider.

Ruurd Boeke Joins Microsoft’s Silverlight (not Entity Framework) Team

Ruurd notes in his I’m joining Microsoft!! post of July 25, 2008 that:

I was torn between working on EF (which, I’ve been very involved with lately) and on Silverlight. In the end, Silverlight won, because I strongly believe it to be the strongest contender in the client space.

I’m disappointed that Ruurd didn’t choose to join the Entity Framework team. His six-part Introducing Entity Framework Contrib: Easy IPoco implementation V 0.1 series used Postsharp to “[a]utomatically implement the IPoco interfaces. The project is aimed at helping you build your domain layer in a more persistence ignorant way than is possible at this moment.”

Note: Ruurd’s eight-part Workflow as controller: Introducing <M,V,C> where M: ViewModel, V : WPF, C : WF describes an inventive framework that uses WF in an unconventional role, although he won’t call his tutorial a framework.

Jeff Currier Defends SQL Server Data Services’ Missing PUT/POST Response Bodies

Mike Amundsen’s REST PUT/POST Responses contain ETag, but not body - Oops! thread of July 24, 2008 in the SQL Server Data Services (SSDS) - Getting Started says:

I note that the PUT results in a return that includes an ETag (yay!), but that there is no body returned for this PUT. I think this is a problem. ETags act as a version hash for the document body. Yet this Response has no body!

Jeff’s What happened to SSDS PUT/POST responses? post of July 25 replies:

Prior to this rollout the only mechanism that we had to communicate version information to you was via the entity body of the response (specifically the version element in the body).  However, now that we have true ETag support we now can simply return this value back to caller via the ETag header per the Http spec.

Jeff attributes the reason for the change to future ingress and egress charges; returning the body would increase downloaded bytes.

Beth Massi Posts Four WPF Forms Over Data Video Segments to the Code Gallery

Her WPF Forms over Data: 2 More Videos! post of July 24, 2008 announces #3 and #4 in the following series about data binding in WPF:

  1. How Do I: Create a Simple Data Entry Form in WPF?
  2. How Do I: Display Data in a List in WPF?
  3. How Do I: Create Lookup Combobox in WPF?
  4. How Do I: Hook Up and Display Validation in WPF?

Click the Watch Video link to substitute MediaPlayer for the miniature Silverlight window. VB and C# sample code is downloadable.

Charlie Calvert Continues with Aggregate Operators in his Revived LINQ Farm Series

Charlie’s LINQ Farm: More on the LINQ Aggregate Operators discusses the following LINQ aggregate operators and their overloads:

  • Count and LongCount
  • Min and Max
  • Average
  • Sum
  • Aggregate

Jeremy D. Miller and Ward Bell Discuss Object/Relational Modeling and the Entity Framework in a Two-Part Podcast

The first ALT.NET Object-Relational Mapping podcast with Jeremy D. Miller and Ward Bell covers Object/Relational Mapping (O/RM) tools and when to use them. Topics include:

  • Object-Relational Mapping
  • Object-first vs. Data-first Approaches
  • Evolutionary Database Design
  • Evolutionary Design
  • Code Generation
  • Persistence Ignorance
  • POCO
  • Domain-Driven Design
  • The Vietnam of Computer Science

    The second part “discusses the Vote of No Confidence on Microsoft's Entity Framework and what it means for the Alt.NET and .NET communities.”

    Scott Hanselman Does a Video Deep Dive on LINQ and the Entity Framework

    The actual title of Scott’s Jumpstart Data Driven Web Applications with ASP.NET 3.5 (Part 1 of 2) presentation for Tech*Ed 2008 Developer is “WUX101: Jumpstart Data-Driven Web Applications with ASP.NET 3.5 Dynamic Data Controls (Part 1 of 2).”

    Note: ASP.NET 3.5 Dynamic Data Controls became ASP.NET Dynamic Data after Tech*Ed.

    The deck for the presentation reads:

    Explore the new features in ASP.NET 3.5 that make buliding data driven Web applications a breeze. In this first of a two-part series, learn how to use LINQ to take the pain out of interacting with your relational data and how support for LINQ and its constructs are built into the paradigms you are familiar with in ASP.NET and Microsoft Visual Studio 2008.

    Hopefully the TechEd Online News folks will post Part 2 shortly.

  •