开发者

Code First CTP4 Error Mapper

Why my type always returns 0?

public class PartiesConfiguracao : EntityConfiguration<Parties>
{
    public PartiesConfiguracao()
    {
        MapHierarchy()
        .Case<Parties>(parties => new
        {
            PartiesID = parties.ID,
            ShipInstructionID = parties.ShipInstruction.ID,
            ContactID = parties.Co开发者_开发知识库ntact.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");
    }
}


MapHierarchy is related to CTP4 and has been removed in CTP5. No further support is provided. You should download and install CTP5 from here and try using the new fluent API introduced in CTP5 for your TPH mapping.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜