Monthly Archives: June 2009

T4 for View Generation

EF team blogged about it here and I think that it’s very useful. First, I think that it’s easier to use than Edmgen. Moreover, contrary to EdmGen, it allows you to use embedded metadata artifacts. If you want to use … Continue reading

Posted in 10511, 7671, 7674 | Leave a comment

POCO T4

With EF4 features CTP1, we have a great POCO template which is divided in two tt files to allow us to have the entitiy POCO classes and the context in different projects. It’s very very cool. However, I think that … Continue reading

Posted in 10511, 10550, 7671, 7674 | Leave a comment

SubObjectSet

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>(). … Continue reading

Posted in 7671, 7674 | Leave a comment

Entity Framework v2: How to get only one entity easier with EF4

Alex James wrote an extension method which allows to get only one entity from a query and the entity key. If we have the key, I think it’s useless to allow it for all queries and it’s useful only for … Continue reading

Posted in 7671, 7674 | 3 Comments

Entity Framework: Undo Redo v2

After my first Undo Redo POC version, one of my customers wanted to be able to manage many actions per Undo / Redo. So I added two extension methods: BeginGroupOfUndoActions and EndGroupOfUndoActions. My code is now this one: public static … Continue reading

Posted in 7671, 7674 | 10 Comments

EF : Undo Redo

How to use Undo/Redo with EntityFramework? This isn’t managed by EF. So we will have to do it ourselves. We could clone the entities and group them into a Stack but in this case I worry about my memory usage growing … Continue reading

Posted in 7671, 7674 | Leave a comment

How to split your EDM v2?

After my previous post about it, my customer asks me the following question: how to get a complete graph (with categories, suppliers, products, order details, orders, customers and employees)? To realize it, we have to add “sort of” navigation properties … Continue reading

Posted in 7671, 7674, 7675 | Leave a comment