EF classes which inherit from EntityObject descendant RRS feed

  • Question

  • Hi,

    I'm trying to port a test app to the entity framework. All the existing entity classes inherit from a base entity type in our framework, and not being able to do this with the EF entities is a major headache. I understand all the discussions on POCOs and persistence ignorance, but I'm wondering if there may be a compromise I could take advantage of. If I were to make our framework's base entity class inherit from EntityObject, I would then get classes that work with the EF but also

    contain the stuff from our framework that I need to port the app. What's the best way of achieving this? Clearly I could just go in and hand edit the generated classes, but that's a non-starter. I've been looking at the stuff on codegen events in http://blogs.msdn.com/dsimmons/archive/2007/09/01/ef-codegen-events-for-fun-and-profit-aka-how-to-add-custom-attributes-to-my-generated-classes.aspx, and I think I might be able to achieve what I want that way, but before I invest too much effort in that approach, is there an easier way to do this, whilst still using the EDM designer to work on the model?



    Monday, August 25, 2008 11:00 PM


All replies