예제 #1
0
 public List<ProductConfigure> SelProductConfigureById(string ProductId)
 {
     List<ProductConfigure> list = null;
     try
     {
         IParameterMapper ipmapper = new SelProductConfigureParameterMapper();
         DataAccessor<ProductConfigure> tableAccessor;
         string strSql = @"select p.ProductId, p.LoveCount,p.Count from ProductConfigure p
                     where p.ProductId=@ProductId";
         tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder<ProductConfigure>.MapAllProperties()
             .Map(t => t.ProductId).ToColumn("ProductId")
              .Map(t => t.LoveCount).ToColumn("LoveCount")
             .Map(t => t.Count).ToColumn("Count")
             .Build());
         list = tableAccessor.Execute(new string[] { ProductId }).ToList();
         return list;
     }
     catch (Exception ex )
     {
         Logger.Log(ex);
         return null;
     }
 }
        public List <ProductConfigure> SelProductConfigureById(string ProductId)
        {
            List <ProductConfigure> list = null;

            try
            {
                IParameterMapper ipmapper = new SelProductConfigureParameterMapper();
                DataAccessor <ProductConfigure> tableAccessor;
                string strSql = @"select p.ProductId, p.LoveCount,p.Count from ProductConfigure p
                            where p.ProductId=@ProductId";
                tableAccessor = db.CreateSqlStringAccessor(strSql, ipmapper, MapBuilder <ProductConfigure> .MapAllProperties()
                                                           .Map(t => t.ProductId).ToColumn("ProductId")
                                                           .Map(t => t.LoveCount).ToColumn("LoveCount")
                                                           .Map(t => t.Count).ToColumn("Count")
                                                           .Build());
                list = tableAccessor.Execute(new string[] { ProductId }).ToList();
                return(list);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                return(null);
            }
        }