Exemple #1
0
        /// <summary>
        /// 使用属性名称的创建
        /// </summary>
        /// <param name="context">上下文</param>
        /// <param name="propertyName">属性名称</param>
        public TableSet(TableContext context, string propertyName)
        {
            _context = context;
            var keyValue = _context.ContextMap.GetState(this.GetType(), propertyName);

            if (keyValue.Key != null)
            {
                SetState = keyValue.Value; Name = SetState.SetAtt.Name;
            }
        }
Exemple #2
0
        /// <summary>
        /// 使用属性名称的创建
        /// </summary>
        /// <param name="context">上下文</param>
        /// <param name="propertyName">属性名称</param>
        public TableSetCache(TableContext context, string propertyName)
        {
            _set = new TableSet <TEntity>(context, propertyName);

            var keyValue = _set._context.ContextMap.GetState(this.GetType(), propertyName);

            if (keyValue.Key != null)
            {
                _set.SetState = keyValue.Value; _set.Name = _set.SetState.SetAtt.Name;
            }
        }
Exemple #3
0
 public TableSet(TableContext context, string name)
 {
     _context = context;
     _name    = name;
 }
Exemple #4
0
 /// <summary>
 /// 使用属性类型的创建
 /// </summary>
 /// <param name="context">上下文</param>
 /// <param name="pInfo">属性类型</param>
 public TableSetCache(TableContext context, PropertyInfo pInfo) : this(context, pInfo.Name)
 {
 }