2012-09-13 61 views
2

使用純POCO進行代碼優先遷移。實體框架5 - 可擴展枚舉在添加遷移時被忽略

這裏是我的類:

[Table("Contact")] 
public class Contact 
{ 
    public int Id { get;set; } 
    public string Name { get;set; } 
    public Prefix? Prefix { get;set; }//added this one then perform Add-Migration 
} 

public enum Prefix 
{ 
    Gen, 
    Dr, 
    Ms, 
    Mr, 
    Mrs, 
    Prof, 
    Rep, 
    Sen, 
    St 
} 

我加了前綴的枚舉,但在執行時添加,遷移簡單地忽略它?

回答