Example #1
0
        /// <summary>
        /// 查詢 - 多筆
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="model"></param>
        /// <param name="dao"></param>
        /// <param name="conn"></param>
        /// <param name="trns"></param>
        /// <returns></returns>
        public static IList <T> QueryList <T>(this T model, IDBUtil dao,
                                              DbConnection conn = null, DbTransaction trns = null) where T : IDBEntity
        {
            //處理 where 參數
            var whereParams = prepareWhereParams(model.GetOperating().WHERE_LIST);

            //處理 order by 參數
            string[] orderByFileds = prepareOrderBy(model.GetOperating().ORDER_LIST);

            //查詢
            return(dao.QueryByTableAndOrderBy <T>(
                       model.GetTableName(), whereParams, orderByFileds, conn, trns));
        }