Entity Framework Issues

I’ve come across two issues with the Entity Framework, one that effects any language and one just for VB.NET

It’s quite simple, the Entity Framework generates edmx files, however that Inherits Global.System.Data.Objects.DataClasses.EntityObject, which means when you create your Partial class you can not Inherit from your own base class.

The second issue is related to VB.NET, as if you are intending to use Dependence Injection or IoC you need to have an Interface defined and to implement an Interface in VB.NET you must add Implements after each Property and Method, which you can not do as the framework generates it’s own code.

I’ve attached both C# and VB.NET examples, none of which compile

Entity Framework Issues.zip (42.58 kb)

2 thoughts on “Entity Framework Issues”

  1. both issues go away in v2 of EF e.g. http://blogs.msdn.com/efdesign/archive/2009/01/22/customizing-entity-classes-with-t4/
    In v1 you can also get round these to some extent.

    – You don’t have to inherit from our base class – you just need our interfaces http://msdn.microsoft.com/en-us/library/bb738631/

    – You don’t need to use our generated classes at all – you can gen your own using codesmith or t4. A number of folks are doing this but I don’t underestimate the work involved e.g. http://blog.tonysneed.com/?p=148

Leave a Reply

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