EF实体类的枚举属性映射设计方法

    public class FoundationInfo 
    {
        [Column("id")]
        public int ID
        {
            get;
            set;
        }


        public InvestType Ctype
        {
            get { return (InvestType)Ctype2; }
            set { Ctype2 = (int)value;}
        }

        private int _ctype;

        [Column("Ctype")]
        public int Ctype2 { get; set; }

        
    }

    public enum InvestType
    {
        股票=1,
        债券 = 2,
        货币 = 3
     
    }


原文地址:https://www.cnblogs.com/keanuyaoo/p/3257911.html