问题:
entitytype has no key defined
Solution:
- 增加引用
- 增加关键字[Key]
using System.ComponentModel.DataAnnotations; [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContactsID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] [Key] public int ContactsID { get { return this._ContactsID; } set { if ((this._ContactsID != value)) { this.OnContactsIDChanging(value); this.SendPropertyChanging(); this._ContactsID = value; this.SendPropertyChanged("ContactsID"); this.OnContactsIDChanged(); } } }
时间: 2024-11-05 17:26:31