When I try to insert a record using Entity frame work to SQL Database i got below error
System.Data.Entity.ModelConfiguration.ModelValidationException: One or more validation errors were detected during model generation:
DAL.EntityFramework.DataTable: : EntityType 'DataTable' has no key defined. Define the key for this EntityType.
DAL.EntityFramework.CultureInfo: : EntityType 'CultureInfo' has no key defined. Define the key for this EntityType.
DAL.EntityFramework.DateTimeFormatInfo: : EntityType 'DateTimeFormatInfo' has no key defined. Define the key for this EntityType.
DataTables: EntityType: EntitySet 'DataTables' is based on type 'DataTable' that has no keys defined.
CultureInfoes: EntityType: EntitySet 'CultureInfoes' is based on type 'CultureInfo' that has no keys defined.
DateTimeFormatInfoes: EntityType: EntitySet 'DateTimeFormatInfoes' is based on type 'DateTimeFormatInfo' that has no keys defined.
What I have tried:
[Table("InventoryE")]
public class InventoryE
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public int ID { get; set; }
public string ITEM_SID { get; set; }
public int SBS_NO { get; set; }
public string ALU { get; set; }
public string STYLE_SID { get; set; }
}