开发者

edmx - The operation could not be completed - After adding Inheritance

开发者 https://www.devze.com 2022-12-25 11:46 出处:网络
I have an edmx model which I have draged 2 tables onto - One called \'File\' and the other \'ApplicaitonFile\'. These two tables have a 1 to 1 relationship in the database. If I stop here everything w

I have an edmx model which I have draged 2 tables onto - One called 'File' and the other 'ApplicaitonFile'. These two tables have a 1 to 1 relationship in the database. If I stop here everything works fine.

But in my model, I want 'ApplicaitonFile' to inherit from 'File'. So I delete the 1 to 1 relationship then c开发者_高级运维onfigure 'ApplicaitonFile' from 'File' and then remove the FileId from 'ApplicaitonFile' which was the primary key. (Note I am following the instructions from here).

If I leave the model open at this point everything is fine, but as soon as I close it, if I try and reopen it again I get the following error "The operation could not be completed".

I have been searching for a solution and found this - Entity Model does not load but as far as I can tell I don't have a duplicate InheritanceConnectors (although I don't know exactly what I'm looking for but I can't see anything out of the ordinary - like 2 connectors with the same name) and the relationship I originally have is a 1 to 1 not a 1 to 0..1

Any ideas???


VS2013 + EF6. I close solution and delete folders BIN and OBJ in project folder. That helped.


I have had issues with EDMX files not opening becuase of layout issues. When it happens i got the "The operation could not be completed."

Try this (please make sure you back up your model).

Open up your model using VS XML Editor (right click open with).

Remove or comment out the section

<edmx:Edmx ...
  ...
  <edmx:Designer>

    <edmx:Diagrams>
       <Diagram>
           //Comment these out   ...
        </Diagram>
    </edmx:Diagrams>
   </edmx:Designer>
 </edmx:Edmx>

so it would become:

<edmx:Edmx ...
  ...
  <edmx:Designer>

    <edmx:Diagrams>
       <!--
       <Diagram>

        </Diagram>
       -->
    </edmx:Diagrams>
   </edmx:Designer>
 </edmx:Edmx>

Then close and reopen the model. If it works* you need to remove the stuff you commented out. Worked for me, hopefuly it works for you.


I was facing issue in open entity model opening. It prompted the error "The operation could not be completed"

I found few tags that were not closed in my Entities.edmx.diagram file. So, it was not a valid xml format.

I corrected the Entities.edmx.diagram xml file which resolved it for my issue.

0

精彩评论

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

关注公众号