为什么我的类型总是返回0?
public class PartiesConfiguracao : EntityConfiguration<Parties>
{
public PartiesConfiguracao()
{
MapHierarchy()
.Case<Parties>(parties => new
{
PartiesID = parties.ID,
ShipInstructionID = parties.ShipInstruction.ID,
ContactID = parties.Contact.ID,
parties.Name,
Type = 0,
parties.CNPJ,
parties.Address
})
.Case<Shipper>(parties => new
{
Type = 1
})
.Case<Consignee>(parties => new
{
Type = 2
})
.Case<Notify>(parties => new
{
Type = 3
})
.Case<Forwarder>(parties => new
{
Type = 4
})
.ToTable("si_Parties");
}
}
答案 0 :(得分:0)
MapHierarchy 与CTP4相关,已在CTP5中删除。没有提供进一步的支持。您应该从here下载并安装CTP5,并尝试使用CTP5中引入的新的流畅API进行TPH映射。