我有一个名为“ CurrencyPairComponent”的实体,它继承了
public class CurrencyPairComponent : RequestComponent
但是即使有了这个种子,它也不会出现在数据库表中。
entityTypeBuilder.HasData(
new CurrencyPairComponent()
{
Id = 1,
CurrencyPairId = 1,
ComponentType = ComponentType.Ask,
QueryComponent = "1",
RequestId = 1,
RequestComponentData = new List<RequestComponentDatum>(),
CreatedAt = DateTime.Now,
ModifiedAt = DateTime.Now,
DeletedAt = null
},
new CurrencyPairComponent()
{
Id = 2,
CurrencyPairId = 1,
ComponentType = ComponentType.Bid,
QueryComponent = "0",
RequestId = 1,
RequestComponentData = new List<RequestComponentDatum>(),
CreatedAt = DateTime.Now,
ModifiedAt = DateTime.Now,
DeletedAt = null
},
new CurrencyPairComponent()
{
Id = 3,
CurrencyPairId = 2,
ComponentType = ComponentType.Ask,
QueryComponent = "0",
RequestId = 2,
RequestComponentData = new List<RequestComponentDatum>(),
CreatedAt = DateTime.Now,
ModifiedAt = DateTime.Now,
DeletedAt = null
}
);
}
怎么回事?我是否使用了不正确的HasData?关于has been recently introduced in .NET Core 2.1.
的HasData用例,没有任何特定信息。