标签:
问题:
entitytype has no key defined
Solution:
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(); } } }
MVC初学 - Entitytype has no key defined
标签:
原文地址:http://www.cnblogs.com/zero530/p/4703838.html