I\'ve narrowed this down to some issue between Code First and Database first EF, but I\'m not sure how to fix it. I\'ll try to be as clear as I can, but I honestly am missin
This is a late entry for those (like me) who didn't immediately understand the other 2 answers.
So...
EF is trying to map to the EXPECTED name from the PARENT TABLES KEY-REFERENCE...and since...the FOREIGN KEY name was "changed or shortened" in the databases CHILD TABLE relationship...you would get the message above.
(this fix may differ between versions of EF)
FOR ME THE FIX WAS:
ADDING the "ForeignKey" attribute to the model
public partial class Tour
{
public Guid Id { get; set; }
public Guid CategoryId { get; set; }
[Required]
[StringLength(200)]
public string Name { get; set; }
[StringLength(500)]
public string Description { get; set; }
[StringLength(50)]
public string ShortName { get; set; }
[StringLength(500)]
public string TourUrl { get; set; }
[StringLength(500)]
public string ThumbnailUrl { get; set; }
public bool IsActive { get; set; }
[Required]
[StringLength(720)]
public string UpdatedBy { get; set; }
[ForeignKey("CategoryId")]
public virtual TourCategory TourCategory { get; set; }
}