Code First CTP4 Error Mapper
- by user506062
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.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");
}
}