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.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

11 thoughts on “Entity Framework POCO Template for .NET 3.5

  1. 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. Pure POCO. 🙂 I’ll be doing this for one of my upcoming Pluralsight videos.

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

  3. 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.

  4. @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. 🙂

  5. Thanks Julie. I’m stuck with VS2008, .NET 3.5 and EF1 for the project I am currently working on. If I adapt the POCO template from the gallery to .NET 3.5, is there anything I need to watch out for? I can live with the generated POCOs not being totally clean if that’s what it will take to maintain relationships. I picked up a copy of your book yesterday and will be spending a lot of today reading so sorry if you’ve answered these questions elsewhere. Thanks again.

Leave a Reply to admin Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.