Entity Framework POCO Template for .NET 3.5

UPON REFLECTION, I DECIDED THAT THIS POST WAS PRETTY MISGUIDED (must have been one of those days...).

So, for safety , I have removed it completely.

You *can* use T4 to customize the code generated for EntityObjects but if you begin with the T4 EntityObject template and replace .NET 4.0 specific logic with old style. FOr example ObjectSet & CreateObjectSet needs to be replaced by ObjectQuery and CreateQuery.

When I have some time, I will update this post to show how to do it.

#1 King Wilder on 3.21.2010 at 1:54 PM

This looks nice and convenient. Question: These generated classes, are they really just C# classes? They aren't associated with the Entity Framework classes or Linq-To-Sql classes, are they?

Any possibility in you making a short "how-to" video on this?

Thanks.

#2 Julie on 3.21.2010 at 2:13 PM

Pure POCO. :) I'll be doing this for one of my upcoming Pluralsight videos.

[http://thedatafarm.com/blog/data-access/two-more-entity-framework-videos-on-pluralsight]

#3 Venkatesh on 4.04.2010 at 10:59 PM

Hi,

I would like to know if we have the Poco feature for VS 2008 also.

#4 Julie on 4.05.2010 at 8:55 AM

The POCO support is new to VS2010 and .NET 4.0.

#5 warmcold on 4.16.2010 at 11:46 PM

I think, the Model1.cs will fail in compiling if target .NET 3.5. The Model1.cs actually uses the ObjectSet(Of TEntity) class, which is only supported by .NET 4.

#6 Julie on 4.18.2010 at 10:06 AM

@warmcold...why did I think I was finding one that was designed for .NET 3.5. Now what I'm seeing is ObjectSets. So step 2 is to modify the T4 to return .NET 3.5 style code. :)

#7 Deepak on 8.18.2010 at 4:26 AM

I was looking for this very badly and can you please post your approach in your blog.

Leave a Comment