Exemplo n.º 1
0
        protected Query()
        {
            Type t = typeof(T);

            ValuePairs = EntityTableMapper.GetColumns(t);
            Reduce     = new QueryParameterReduce();
            Reduce.AddTable(t);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据主键查询数据
        /// </summary>
        /// <param name="pkValue"></param>
        /// <returns></returns>
        public T Get(Object pkValue)
        {
            Type   t    = typeof(T);
            String name = EntityTableMapper.GetPkColumn(t);
            Expression <Func <T, Boolean> > expression = PropertyValueExpression <T> .BuildExpression(name, pkValue);

            return(_executeBatch.Query(_query.Select().Where(expression).End()));
        }
Exemplo n.º 3
0
 private void SetQueryOtherTable <T1>(Expression <Func <T1, Object> > query = null)
 {
     lock (_lock)
     {
         Type tablename  = typeof(T1);
         var  valuePairs = EntityTableMapper.GetColumns(tablename);
         if (query == null)
         {
             foreach (var item in valuePairs)
             {
                 Reduce.AddQuery(tablename, item.Key);
             }
         }
         else
         {
             Reduce.AddQuery(query);
         }
     }
 }
Exemplo n.º 4
0
 static Query()
 {
     EntityTableMapper.Add(typeof(T));
 }
Exemplo n.º 5
0
 static Renewal()
 {
     EntityTableMapper.Add(typeof(T));
 }