zoukankan      html  css  js  c++  java
  • 调查一下,EF的Bug?

    数据库中有3表Person、Student、Worker。代码如下:

    Code

    现在在VS里建个ADO.NET Entity Data Model,就叫默认的Model1.edmx好了,操作如下:

    1、建立Model1.edmx时,在数据库中只选择Person表,完成Model1.edmx

    2、编译,通过

    3、现在从数据库中更新,把Student和Worker都添加进来,这是会看到设计器自动把实体和关系都一并生成出来,还算蛮聪明的

    4、编译,还是通过

    5、Bug开始来了,把Student和Worker实体删除

    6、编译,出错,我在中文版和英文版都试过(打正式sp1的,team system),错误如下:

    Error    1    Error 3013: Problem in Mapping Fragment starting at line 144: Missing table mapping: Foreign key constraint 'FK_Student_Person' from table Student (PersonID_FK) to table Person (PersonID): no mapping specified for the table Student.
    Error    2    Error 3013: Problem in Mapping Fragment starting at line 144: Missing table mapping: Foreign key constraint 'FK_Worker_Person' from table Worker (PersonID_FK) to table Person (PersonID): no mapping specified for the table Worker.

    按照微软讲师王然在webcast的说法,EF有时没有自动把后台代码删除完整,当时那webcast演示也是出错所以终止的。但他说是因为他的是beta版的原因。但我这几天测试了N次,发现在sp1正式版也出现这情况……郁闷

    大家也出现过这现象吗?

  • 相关阅读:
    BZOJ 4710: [Jsoi2011]分特产
    P4859 已经没有什么好害怕的了
    BZOJ 2839 集合计数
    P1450 [HAOI2008]硬币购物
    P3440 [POI2006]SZK-Schools
    P4177 [CEOI2008]order
    对于最小割的进一步理解
    P2774 方格取数问题
    JAVA网络编程TCP通信
    JAVA多线程及补充
  • 原文地址:https://www.cnblogs.com/Dreaming/p/1280024.html
Copyright © 2011-2022 走看看