开发者

Code First CTP4 Error Mapper

开发者 https://www.devze.com 2023-02-02 12:04 出处:网络
Why my type always returns 0? public class PartiesConfiguracao : EntityConfiguration<Parties> { public PartiesConfiguracao()

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

精彩评论

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