コード例 #1
0
 public List <Message> GetMessages()
 {
     using (var conn = _dbConnection.GetConnection())
     {
         return(_messageDataAccess.GetMessages(conn));
     }
 }
コード例 #2
0
        public List <Message> GetBackMessage(int userId, string text, DateTime createdDate)
        {
            using (var conn = _dbConnection.GetConnection())
            {
                _messageDataAccess.AddMessage(conn, userId, text, createdDate);

                if (text == "")
                {
                    throw new Exception("no text");
                }
                return(_messageDataAccess.GetMessages(conn));
            }
        }
コード例 #3
0
        public Result <PagedList <MessageModel> > GetMessages(int userId, int pageIndex, int pageSize)
        {
            var result = new Result <PagedList <MessageModel> >
            {
                Data   = messageDataAccess.GetMessages(userId, pageIndex, pageSize),
                Status = new Status()
                {
                    Code = "1", Message = ""
                }
            };

            return(result);
        }