I have the following
[DataContractAttribute]
public class Animal
{
[Key]
[XmlElement(ElementName = "Id")]
[DataMember()]
public Guid Id
{
get;
set;
}
[XmlElement(ElementName = "AnimalType")]
[DataMember()]
public List<AnimalType> AnimalType
{
get;
set;
}
}
And I map it with the first code approach from EF to tables
modelBuilder.Entity<Animal>().ToTable("Animal");
As you can see, I didn’t perform any complicated display, but the List of AnimalType enumerations were not automatically mapped to any columns / tables in the database. Do I need to add additional code to the model constructor to control the display of the list of enumerations?
source
share