Entity Framework CTP 5 - First Code Mappings - Cannot Display Enumeration List Correctly

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?

+3
source share
2 answers

EF CTP5, . , RTM, 2011 .

+8

, EF, , .

, , , EF , . ? ? ? , , , , .

+1

Source: https://habr.com/ru/post/1780473/


All Articles