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!
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.
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]
Hi,
I would like to know if we have the Poco feature for VS 2008 also.
The POCO support is new to VS2010 and .NET 4.0.
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.
@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. 🙂
I was looking for this very badly and can you please post your approach in your blog.
Hi Julie. You say that for safety you have removed the original post. Can you please explain what exactly is unsafe?
By the way, thanks for the videos you’ve made available. They’re helping a lot as I learn my way around entity framework.
@luke,
"safety" in that I don’t want to misguide anyone. You can get the proper poco template from visualstudiogallery.com. 🙂
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.