我最初在聚合中使用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# –