문제

I used to have one Working edmx model with WCF service.

Then I've added another Entity Model pointing another connection.

I will try to explain in nutshell what is happened in app.config.

  • there is still being one connectionString with old name
  • but now it points new entity model
  • but initial catalog is not even updated to new one and points to old one

I'm sure that something is wrong here. And I also can't find can I change / edit it from properties.

Is it possible to have two Entity Models in one project? If so then what could cause such things in my situation?

도움이 되었습니까?

해결책

I had a similar problem a while back where I had two models in one project which worked fine at first. My problems started when I had to reference the same table in both models, specifically as the generated POCOs were in the same project.

In the end, put the two edmxs in separate projects. Julie Lerman in this tutorial says this is a perfectly fine thing to do.

다른 팁

Yes, you can have many .edmx models in one project; what you have to do is put each Model.tt in different projects and remove them from the project where are the .edmx models. So you have something like this:

- com.DataAccessLayer
- com.Entities.Model1
- com.Entities.Model2

Each model uses different connection string if you want to connect to different data bases.

Here you can find how to separete Model.tt from Model.edmx http://nullablecode.com/2013/09/splitting-entity-framework-model-classes-separate-projects/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top