I have recently migrated my project from .net framework 4.7.2 to .net core - net6.0 and it seems EF core can no longer see the auto generated FK columns that "old" EF created. "Old" EF created them with an underscore, e.g RetailerReview_Id but EF Core is expecting a column name to be RetailerReviewId. This is code first.
This is my parent model:
[Table("fooRetailerReview")]
public class RetailerReview
{
[Key]
public int Id { get; set; }
public string RetailerId { get; set; }
[Range(1, 5)]
public int RetailerRating { get; set; }
[Range(1, 5)]
public int ProductRating { get; set; }
public string Title { get; set; }
[StringLength(500)]
public string Content { get; set; }
public string Response { get; set; }
public ICollection<RetailerReviewImage> Images { get; set; }
[StringLength(500)]
public string LowRatingReason { get; set; }
public virtual ICollection<RetailerReviewImage> ConnectRetailerReviewImages { get; set; } = new List<RetailerReviewImage>();
}
And this is the ICollection for RetailerReviewImage linked model:
[Table("fooRetailerReviewImage")]
public class RetailerReviewImage
{
[Key]
public int Id { get; set; }
public int ContentLinkId { get; set; }
public ApprovalState ApprovalState { get; set; }
public string RejectionReason { get; set; }
public int Review_Id { get; set; }
public DateTime DateLastModified { get; set; }
}
The Db tables were automatically created as well as the FK Column which on fooRetailerReviewImage
table is RetailerReview_Id:

Before moving to EF core this was all working, but now when running (and debugging) I get the following error:
Invalid column name 'RetailerReviewId1'.
Invalid column name 'RetailerReviewId'.
Invalid column name 'RetailerReviewId1'.
Like I said, nothing else has changed. Can anyone assist or do I need to raise a bug?