Given the following entity:
public partial class InstructorPartition
{
[Key]
[Column(Order = 0)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int FkInstructorId { get; set; }
[Key]
[Column(Order = 1)]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int PartitionId { get; set; }
}
EF 6.1.3 is generating an additional column in queries, which doesn't exist (and causing errors in SQL)
dc.InstructorPartitions
{SELECT
[Extent1].[FkInstructorId] AS [FkInstructorId],
[Extent1].[PartitionId] AS [PartitionId],
[Extent1].[Instructor_InstructorId] AS [Instructor_InstructorId]
FROM [dbo].[InstructorPartitions] AS [Extent1]}
base: {SELECT
[Extent1].[FkInstructorId] AS [FkInstructorId],
[Extent1].[PartitionId] AS [PartitionId],
[Extent1].[Instructor_InstructorId] AS [Instructor_InstructorId]
FROM [dbo].[InstructorPartitions] AS [Extent1]}
Local: Count = 0
Why is EF generating the "Instructor_InstructorId" column reference (which doesnt exist)?
Expected query wouldn't include the Instructor_InstructorId
Also, looked through OnModelCreating to make sure nothing "added" to InstructorPartition entity.