Esempio n. 1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="filter"></param>
        internal PropertyConvention(Func <PropertyInfo, bool> filter)
        {
            Guard.ArgumentNotNull(filter, nameof(filter));

            Filter       = filter;
            DbColumnRule = DbColumnRule.None;
        }
Esempio n. 2
0
 /// <summary>
 /// 指示该属性不映射到数据库。
 /// </summary>
 /// <returns></returns>
 public void Ignore()
 {
     DbColumnRule = DbColumnRule.Ignore;
 }
Esempio n. 3
0
 /// <summary>
 /// 自增主键
 /// </summary>
 public void AutoGenerateKey()
 {
     DbColumnRule = DbColumnRule.AutoGeneration | DbColumnRule.Key;
 }
Esempio n. 4
0
 /// <summary>
 /// 自增
 /// </summary>
 public void AutoGeneration()
 {
     DbColumnRule = DbColumnRule.AutoGeneration;
 }
Esempio n. 5
0
 /// <summary>
 /// 指示该属性是一个数据库的主键。
 /// </summary>
 /// <returns></returns>
 public void IsKey()
 {
     DbColumnRule = DbColumnRule.Key;
 }
Esempio n. 6
0
 /// <summary>
 /// 指示该属性不映射到数据库。
 /// </summary>
 /// <returns></returns>
 public void Ignore()
 {
     this.ColumnRule = DbColumnRule.Ignore;
 }
Esempio n. 7
0
 /// <summary>
 /// 指示该属性是一个数据库的主键。
 /// </summary>
 /// <returns></returns>
 public void IsKey()
 {
     this.ColumnRule = DbColumnRule.Key;
 }