开发者

Stop VS Entity Framework Designer from reverting to the name "Entities"

I have a Visual Studio 2010 Entity Framework 4 WPF project and I'm not saving my connection string in app.config. This seems to be confusing the EF designer, since it wants to take the name of the entity container from the name of the connection string, which doesn't exist. The main problem I'm having is that every time I update from the database, my entity container is renamed to "Entities". Since this isn't the name I want, I have to refactor the name back after every update.

Other than adding a named connection string to app.config, is there any way to stop Visual Studio from messing with开发者_如何学编程 my entity container name?


The name of your context has nothing to do with your connection strings. It retrieves the name from the model property Entity Container Name. So open up your .edmx file and assign this property to whatever you like.

Stop VS Entity Framework Designer from reverting to the name "Entities"


Context name is not infered from name of the connection string but from the name of EF Container. Open EF Designer and in its properties change Entity Container Name.

Stop VS Entity Framework Designer from reverting to the name "Entities"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜