我最初在聚合中使用Enum,碰巧對我來說工作正常,但現在當我將屬性更改爲List時,我發現值不會在數據庫中保存或檢索,我認爲CodeFirst會爲List創建一個單獨的表並映射這些行,但事實並非如此,這些值既不被存儲也不被retreived。List <Enum> in Aggregates EntityFramework CodeFirst
總比分
public class Trainee: Entity
{
public int TraineeId { get; set; }
public string Name { get; set; }
public int Age { get; set;}
public virtual List<CoursesTypes> CoursesOpted { get; set; }
}
枚舉:
public enum CoursesTypes
{
PHP,
Networking,
}
有一個答案一個同樣的問題:http://stackoverflow.com/questions/28429945/ef-property-of-type-listenum-not -created合分貝?noredirect = 1# –