Tuesday, June 23, 2009

LINQ and Entity Framework Posts for 6/15/2009+

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

ADO.NET Team Blog posts 0f 6/22/2009 for EF v2 CTP 1 will be repeated in the 6/22/2009+ issue.

Entity Framework and Entity Data Model (EF/EDM)

Carl Perry’s Announcing: Entity Framework Feature CTP 1 for the Net Framework 4.0 Beta 1 post of 6/22/2009 notes:

We weren’t able to ship these capabilities in the .NET Framework 4.0 Beta 1 so we’ve decided to release them alongside the Beta.  This CTP is an early preview of these features and as such we’re looking for lots of feedback on these components.  This functionality is currently not scheduled to be part of the .NET Framework 4.0 and we expect to release another CTP of these features based on the feedback we get from you. [Emphasis added.]

Following are CTP1’s new features:

The following posts of 6/22/2009 provide walkthroughs of the new features:

Julie Lerman comments on the ADO.NET Team’s deprecation of System.Data.OracleClient in her Oracle and ADO.NET- Microsoft: Deprecated; Oracle: quiet, DataDirect:Beta and DevArt:Released post of 6/21/2009.

She writes in her EF4: Model-Defined Functions Level 1 & 2 post of the same date:

Model Defined Functions are a great addition to EF4. It allows you to add functions directly into your model rather than having to place the additional logic into business classes. This not only allows the functions to be “just there”, but you can use them in queries, something that you cannot do with properties that are defined in the classes.

Alex James shows you how to avoid superfluous queries and simplify use of EF in Tip 26 – How to avoid database queries using Stub Entities of 6/19/2009.

Beth Massi writes in her WPF Data Binding Samples on Code Gallery post of 6/17/2009:

One of the many samples released for Visual Studio 2010 Beta 1 that you should be aware of are examples of WPF data binding against Entity Data Models. You can find some easy to follow samples here: http://code.msdn.microsoft.com/WPFDatabinding

This sample demonstrates how to create a WPF Forms solution that checks user input with validation code, demonstrates common controls such as DataGrid and ComboBox, and shows typical data manipulation including create, read, update, and delete. The sample solution is available in both Visual Basic and C# and is intended for use with Visual Studio 2010 Beta 1 and with the .NET Framework 3.5.  In the future, we will release a sample that performs with the .Net Framework 4.0 Beta.

Simon Segal’s Entity Framework, Fluent Interfaces & Domain Specific Languages Part 2 of 6/16/2009 continues his tiny DSL series:

In the first part of this series I looked at how you might go about building an (incredibly tiny) domain specific language for analysing data. The context I gave was a scenario where project managers were required to work with a continuous stream of data in the form of a known schema. This ‘known’ schema is most commonly used in moving and transforming data between various systems in a domain where the central or end target is a Document Management System. The ‘known’ schema is an agreed format that all systems in this particular industry use to extract and subsequently load. It is common to see the project managers struggling with tools like access to compose queries to analyse the data before or after these ETL processes and hence proposition of a DSL.

Matthieu Mezil explains how to implement a “sub EntitySet” property in his SubObjectSet post of 6/16/2009. Matthieu writes:

With EF, when you use TPH or TPC inheritance mapping scenarii, the EntitySet is on the base class.

As I mentioned often in the past with EF v1, you can add a property in your context which returns the EntitySet.OfType<MySubType>().

Ok it’s interesting but… In EF v1, the EntitySet is an ObjectQuery<T> property and our property also but in EF v2 the EntitySet is an ObjectSet<T>. This class implements the IObjectSet<T> interface which has three methods to add, attach and delete entities.

One guy tells me that he wants to be able to use these methods directly on the “sub EntitySet” property.

As you would expect, Matthieu provides the implementation.

Faisal Mohamood explains Using Repository and Unit of Work patterns with Entity Framework 4.0 with EF v2 POCO in his detailed post of 6/16/2009. Here are links to his three previous POCO posts:

In this post, Faisal “look[s] at how we might be able to take our example a bit further and use some of the common patterns such as Repository and Unit Of Work so that we can implement persistence specific concerns in our example.”

Jonathan Carter writes in his Gaining some context into ASP.NET AJAX 4’s DataContext… post of 6/18/2009:

The ASP.NET AJAX 4 release has some really cool features in it that can help lower the barrier of entry into developing client-side web applications (jQuery doesn’t hurt either). One of the more compelling new classes is the DataContext. Basically, the DataContext is an object that is capable of consuming a server-side resource that serves JSON data. In its most basic form, you simply give it the URI of a service and the operation name to execute and it handles making the underlying request. If you had an AJAX-enabled ASMX service like so (note: I’m using the Entity Framework)… [Emphasis added.]

and continues with his How the DataContext can change your data and your life (well, sort of, but not really)… post of 6/19/2009.

Himanshu Vasishth’s System.Data.OracleClient Update post of 6/15/2009 announces that Microsoft’s System.Data.OracleClient ADO.NET data provider will be deprecated in favor of third-party Oracle providers in the .NET Framework 4.0:

We learned  that a significantly large portion of customers use our partners’  ADO.NET providers for Oracle;  with regularly updated support for Oracle releases and new features. In addition, many of the third party providers are able to consistently provide the same level of quality and support that customers have come to expect from Microsoft. This is strong testament of our partners support for our technologies and the strength of our partner ecosystem.  It is our assessment that even if we made significant investments in ADO.Net OracleClient to bring it at parity with our partners based providers, customers would not have a compelling reason to switch to ADO.Net OracleClient.

Jaroslaw Kowalski explains Using EFProviderWrappers with precompiled views in this 6/15/2009 post, which notes that":

Injecting a provider into provider chains involves changing SSDL file and that invalidates the hash.

Jarek describes the workaround.

Craig Lee is a member of the EF Tools team who recently started a blog. Following are his first two posts:

Subscribed. Thanks to Alex James for the heads up.


Damien Guard is the interviewee for HerdingCode - Episode 50: Damien Guard on LINQ to SQL, Entity Framework, and Fontography of 6/21/2009:

This week the guys talk to Damien Guard, a developer working on LINQ to SQL and Entity Framework. After discussing data access for a while, they talk about the programming font Damien publishes, Envy Code R.

The post includes a detailed topic list.

Matt Warren posted the 15th chapter of his IQueryable saga, Building a LINQ IQueryable provider - Part XV (IQToolkit v0.15), on 6/16/2009. Matt says his new IQToolkit version offers these new features:

    • More Providers - MySQL and SQLite join the previous MS only line up.
    • Transactions - Use ADO transactions to control the isolation of your queries & updates.
    • Entity Providers - The provider concept is expanded to include tables of entities
    • Entity Sessions - The session concept adds identity caching, change tracking and deferred updates via SubmitChanges
    • Provider Factory - Create providers on the fly w/o knowing anything more than the database name and mapping.
    • Madness

LINQ to Objects, LINQ to XML, et al.

Jim Wooley writes in his Add Extension Methods in LinqPad post of 6/20/2009:

As we already announced, the samples for chapters 1-8 of our LINQ in Action book are available through LINQPad. This includes the LINQ to Objects and LINQ to SQL. I've been working on the LINQ to XML chapters (9-11) and hope that we will add them to the download soon. In the process, I've needed to learn a bit about how LINQPad works under the covers in order to add specialized classes. …

If you need to refer to external methods or add other classes, choose the Program option. This will add a Sub Main method and allow you to add additional methods. …

ADO.NET Data Services (Astoria)

No significant new posts as of 6/23/2009 9:00 AM PDT

ASP.NET Dynamic Data (DD)

No significant new posts as of 6/23/2009 9:00 AM PDT

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

David Ebbo announced A new and improved ASP.NET MVC T4 template in his 6/17/2009 post:

A couple weeks ago, I blogged about using a Build provider and CodeDom to generate strongly typed MVC helpers at runtime.  I followed up a few days later with another version that used T4 templates instead, making it easier to customize.

And now I’m back with yet another post on this topic, but this time with a much simpler and improved approach!  The big difference is that I’m now doing the generation at design time instead of runtime.  As you will see, this has a lot of advantages.

Update: current version is now 0.9.0006 (attached to his post as a zip file)

blog comments powered by Disqus