Using Nightly 6.0.0-alpha3-20404
Repro steps:
Create new console application with inheritance, EdmProperty Model based conventions, and Initializer
comment out ModelBuilder.Conventions.Add line
Run application (populate database)
uncomment ModelBuilder.Conventions.Add line
Run application
"Sequence contains no elements" Exception is thrown
Attached Program.cs contains the model and application logic
model has two classes, one inheriting from the other with a one to many foreign key relationship between the two.
convention:
class ModelBasedConvention : IDbConvention<EdmProperty>
{
public void Apply(EdmProperty property, EdmModel model)
{
property.Name = "_" + property.Name;
}
}
Comments: This is an issue with the ModelDiffer. It occurs when you rename the foreign key column of a self-referencing association. ``` C# class Employee { public int Id { get; set; } // TODO: Uncomment to rename FK column // [Column("Manager_Id")] public int? ManagerId { get; set; } public Employee Manager { get; set; } } ```
Repro steps:
Create new console application with inheritance, EdmProperty Model based conventions, and Initializer
comment out ModelBuilder.Conventions.Add line
Run application (populate database)
uncomment ModelBuilder.Conventions.Add line
Run application
"Sequence contains no elements" Exception is thrown
Attached Program.cs contains the model and application logic
model has two classes, one inheriting from the other with a one to many foreign key relationship between the two.
convention:
class ModelBasedConvention : IDbConvention<EdmProperty>
{
public void Apply(EdmProperty property, EdmModel model)
{
property.Name = "_" + property.Name;
}
}
Comments: This is an issue with the ModelDiffer. It occurs when you rename the foreign key column of a self-referencing association. ``` C# class Employee { public int Id { get; set; } // TODO: Uncomment to rename FK column // [Column("Manager_Id")] public int? ManagerId { get; set; } public Employee Manager { get; set; } } ```