コード例 #1
0
        public async Task <ReplyRes> SaveComment(SaveRep request)
        {
            var result = new ReplyRes()
            {
                RepId   = 0,
                Message = "Something went wrong, please contact administrator."
            };

            try
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@CommentId", request.CommentId);
                parameters.Add("@Text", request.Text);
                parameters.Add("@GameId", request.GameId);
                parameters.Add("@UserId", request.UserId);
                parameters.Add("@RepId", request.RepId);
                result = await SqlMapper.QueryFirstOrDefaultAsync <ReplyRes>(cnn : connection,
                                                                             sql : "sp_SaveReply",
                                                                             param : parameters,
                                                                             commandType : CommandType.StoredProcedure);

                return(result);
            }
            catch (Exception ex)
            {
                return(result);
            }
        }
コード例 #2
0
        public async Task <ReplyRes> Delete(int RepId)
        {
            var result = new ReplyRes()
            {
                RepId   = 0,
                Message = "Something went wrong, please contact administrator."
            };

            try
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@RepId", RepId);
                result = await SqlMapper.QueryFirstOrDefaultAsync <ReplyRes>(cnn : connection,
                                                                             sql : "sp_DeleteRep",
                                                                             param : parameters,
                                                                             commandType : CommandType.StoredProcedure);

                return(result);
            }
            catch (Exception ex)
            {
                return(result);
            }
        }