Code First CTP4 Error Mapper
Posted
by
user506062
on Stack Overflow
See other posts from Stack Overflow
or by user506062
Published on 2011-01-03T20:49:47Z
Indexed on
2011/01/03
20:54 UTC
Read the original article
Hit count: 282
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");
}
}
© Stack Overflow or respective owner