Example #1
0
        public static async Task <IEnumerable <BoardModel> > GetListAsync(string board_type, int page = 1, int page_size = 20)
        {
            //데이터가 많아지면 LIMIT가 느려질수 있다고함, WHERE 로 모집합을 줄이고 LIMIT를 걸어야한다고....
            var sql   = MySqlDapperHelper.GetSqlFromXml("Sql/Board.xml", "GetBoardList");
            var limit = $" LIMIT {(page - 1) * page_size}, {page_size}";

            return(await MySqlDapperHelper.RunGetQueryAsync <BoardModel>(sql + limit, new
            {
                board_type = board_type,
            }));
        }