I will explain using code from solution that I develop.
I have class TextTranslation:
```c#
public class TextTranslation
{
public Guid TextTranslationId { get; set; }
public string Name { get; set; }
public string Text { get; set; }
public Guid LanguageId { get; set; }
public Language Language { get; set; }
}
I generated migration for **TextTranslation**.
Then I declared two classes **Page** and **PageTextTranslation**:
```c#
public class Page
{
public Guid PageId { get; set; }
public string Name { get; set; }
public List<PageTextTranslation> TextTranslations { get; set; }
}
public class PageTextTranslation : TextTranslation
{
//public Guid PageTextTranslationId { get; set; }
//public string Name { get; set; }
//public string Text { get; set; }
//public Guid LanguageId { get; set; }
//public Language Language { get; set; }
public Guid PageId { get; set; }
public Page Page { get; set; }
}
When I generate new migration for those classes I get message "Sequence contains no matching element".
When I comment inheritance for class PageTextTranslation from TextTranslation and uncomment lines, then migration generation is okay.
EF version: 6.2
Database Provider: EntityFramework.SqlServer
Operating system: Windows 10 Pro 1803
IDE: Visual Studio 2017 15.7
In the simple solution this works, but when you have more relations, then EF generates error.
This happens because of indexes:
```c#
modelBuilder.Entity
.Property(tt => tt.Name)
.HasMaxLength(450);
modelBuilder.Entity
.HasIndex(tt => tt.Name)
.HasName("IX_TextTranslations_Name");
modelBuilder.Entity
.HasIndex(tt => tt.LanguageId)
.HasName("IX_TextTranslations_LanguageId");
```
If I remove indexes declaration the migration generation is okay, but I do need this indexes.