Sequence在架構更新中包含多個匹配元素

asp.net-core entity-framework entity-framework-core inheritance

我正在使用這樣的ef-core繼承:

public abstract class Person
{
    public int Id { get; set; }
    public string Name { get; set; }
    public PersonType PersonType { get; set; }
    public int PersonTypeId { get; set; }
    public double Height { get; set; }

    [Timestamp]
    public byte[] Timestamp { get; set; }
}

public class Daughter : Person
{
    public double Weigth { get; set; }
    public DateTime SomeDate { get; set; }
}

public abstract class Son : Person
{
    public DateTime BirthDate { get; set; }
    public DateTime GraduationDate { get; set; }
}

public class SingleSon : Son
{
}

public class SonWithDaughter : Son
{
    public int Daughter { get; set; }
    public Daughter Daughter { get; set; }
}

在DbContext中:

    public DbSet<PersonType> PersonTypes { get; set; }
    public DbSet<Daughter> Daughters { get; set; }
    public DbSet<SingleSon> SingleSons { get; set; }
    public DbSet<SonWithDaughter> SonWithDaughters { get; set; }

當我更新sql server數據庫(dotnet ef數據庫更新)時,它會拋出一個

System.InvalidOperationException,Sequence包含多個匹配元素

關於如何解決這個問題的任何想法?

UPDATE

ef遷移控制台輸出

一般承認的答案

這是問題#5894 。它將在版本1.0.1中修復。在此之前,您可以使用夜間飼料



Related

許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow
許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow