views:

19

answers:

0

Apparently the code generator for the designer class, EntityModelCodeGenerator that is, uses the "Entity Container Name", a property of the model, for the name of the connectionstring; meaning that the model constructor in the designer class that has the named connection string parameter will always be generated using the Entity Container Name. Something like:

    public MyEntities() : 
            base("name=MyEntities", "MyEntities")
    {
        this.OnContextCreated();
    }

Now I know there can be a lot of pro and con arguments, but I was just curious why this constraint? Why can I not have the connecton string with a different name than the entity container? For some reason I might chose to work with 2 models connected to the same database... Or did I get it wrong, and there is a way to configure these two differently, in which case I would appreciate if someone will tell me how?

Thanks in advance Iulian