Exemplo n.º 1
0
        public static BoardModel Get(string board_type, int seq)
        {
            MySqlDapperHelper.RunExecute("UPDATE BOARD SET VIEW_CNT = VIEW_CNT + 1 WHERE BOARD_TYPE = @board_type AND SEQ = @seq", new
            {
                board_type = board_type,
                seq        = seq
            });

            return(MySqlDapperHelper.RunGetQuery <BoardModel>(@"
SELECT
	A.BOARD_TYPE
	,A.SEQ
	,A.TITLE
	,A.CONTENTS
	,A.DUP_KEY
	,A.VIEW_CNT
	,A.STATUS_FLAG
	,A.REG_IP
	,A.REG_USER
	,A.REG_USERNAME
	,A.REG_DATE
FROM
    BOARD A
WHERE
	A.BOARD_TYPE = @board_type
    AND A.SEQ = @seq
ORDER BY
    A.SEQ DESC
", new
            {
                board_type = board_type,
                seq = seq
            }).FirstOrDefault());
        }