zoukankan      html  css  js  c++  java
  • EntityFramework 连接串导致的错误

          默认的以"metadata=res://*/ "开头的连接串包含了对象的键信息,

    View Code
    1 <EntityType Name="table">
    2           <Key>
    3             <PropertyRef Name="UserID" />
    4           </Key>
    5 ...

    所以在类中不必加[Key]等属性,这种方式对于DataBase First方式显得非常重要,每次更新数据库后,类会重新生成,如果用普通的连接串则会报

    System.Data.Edm.EdmEntityType: : EntityType 'table' has no key defined. Define the key for this EntityType

    System.Data.Edm.EdmEntitySet: EntityType: The EntitySet table is based on type table that has no keys defined.

  • 相关阅读:
    mexopencv
    Computer Vision Resources
    Immersive Imaging
    汇编指令
    I/O输入系统
    大容量存储器的结构
    文件系统实现
    文件系统接口
    虚拟内存
    内存管理
  • 原文地址:https://www.cnblogs.com/Ermite/p/2013570.html
Copyright © 2011-2022 走看看