EF 4.1 EntityType has no key - composite
问题 I have just upgraded to the latest EF 4.1 code-first using NuGet and now I am receiving an error regarding my mapping. I have this class public class UserApplication { [Key, Column(Order = 0)] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int UserId { get; set; } [Key, Column(Order = 1)] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int ApplicationId { get; set; } [ForeignKey("ApplicationId")] public virtual Application Application { get; set; } public DateTime