public async Task <VoteResult> CancelVoteAsync(String access, Int32 answerId, String loginId)
        {
            var api    = new AnswerApi();
            var result = await api.CancelVoteAsync(access, answerId, loginId);

            return(result);
        }
        public async Task <OperationResult> CollectAsync(String accessToken, Int32 answerId, IList <Int32> collectionIds)
        {
            var api    = new AnswerApi();
            var result = await api.CollectAsync(accessToken, answerId, collectionIds);

            return(result);
        }
        public async Task <VoteResult> VoteDownAsync(String access, Int32 answerId)
        {
            var api    = new AnswerApi();
            var result = await api.VoteDownAsync(access, answerId);

            return(result);
        }
        public async Task <AnswerHelpedResult> CancelThankAsync(String accessToken, Int32 answerId, String loginId)
        {
            var api    = new AnswerApi();
            var result = await api.CancelThanksAsync(accessToken, answerId, loginId);

            return(result);
        }
        public async Task <AnswerNoHelpeResult> UndoNoHelpAsync(String accessToken, Int32 answerId, String userId)
        {
            var api    = new AnswerApi();
            var result = await api.UndoNoHelpAsync(accessToken, answerId, userId);

            return(result);
        }
        public async Task <AnswerCommentsResult> GetCommentsAsync(String accessToken, String requestUri, Boolean autoCache = false)
        {
            var api    = new AnswerApi();
            var result = await api.GetCommentsAsync(accessToken, requestUri, autoCache);

            return(result);
        }
        public async Task <AnswerRelationshipResult> GetAnswerRelationshipAsync(String accessToken, Int32 answerId, Boolean autoCache = false)
        {
            var api    = new AnswerApi();
            var result = await api.GetRelationshipAsync(accessToken, answerId, autoCache);

            return(result);
        }
        public async Task <FavoriteResult> CheckFavoriteAsync(String access, Int32 answerId, Boolean autoCache = false)
        {
            var api    = new AnswerApi();
            var result = await api.CheckFavoriteAsync(access, answerId, autoCache);

            return(result);
        }
Exemple #9
0
        /// <summary>
        /// Post your answer to this endpoint. It should be a json object that holds a list of subscribers.
        /// </summary>
        /// <param name="token">This is a string token received from the token endpoint</param>
        /// <param name="answer">This is an object with a list of subscriberIds that match the criteria in the exercise</param>
        /// <param name="config">An instance of Configuration</param>
        /// <returns></returns>
        public async Task <API.Model.ApiResponse <AnswerResponse> > SubmitAnswerAsync(string token, Answer answer, Configuration config = null)
        {
            Trace.WriteLine($"Starting {MethodBase.GetCurrentMethod().Name}");
            IAnswerApi api    = new AnswerApi(config);
            var        result = await api.ApiAnswerByTokenPostAsync(token, answer);

            Trace.WriteLine($"Ending {MethodBase.GetCurrentMethod().Name}");
            return(result);
        }
Exemple #10
0
        public BaseResponse Deactivate(int id)
        {
            var answers = AnswerApi.Deactivate(id);

            if (answers != null)
            {
                return new BaseResponse()
                       {
                           Data       = answers,
                           StatusCode = (int)HttpStatusCode.OK
                       }
            }
            ;

            return(new BaseResponse()
            {
                Message = AnswerMsg.NotFound,
                StatusCode = (int)HttpStatusCode.NotFound
            });
        }
Exemple #11
0
        public BaseResponse GetAllAnswersOfUserId(int id)
        {
            var answers = AnswerApi.GetAllAnswersOfUserId(id);

            if (answers != null)
            {
                return new BaseResponse()
                       {
                           Data       = answers,
                           StatusCode = (int)HttpStatusCode.OK
                       }
            }
            ;

            return(new BaseResponse()
            {
                Message = GlobalMsg.InternalError,
                StatusCode = (int)HttpStatusCode.InternalServerError
            });
        }
Exemple #12
0
        public BaseResponse GetAnswerById(int id)
        {
            var answer = AnswerApi.GetAnswerById(id);

            if (answer != null)
            {
                return new BaseResponse()
                       {
                           Data       = answer,
                           StatusCode = (int)HttpStatusCode.OK
                       }
            }
            ;

            return(new BaseResponse()
            {
                Message = AnswerMsg.NotFound,
                StatusCode = (int)HttpStatusCode.NotFound
            });
        }
Exemple #13
0
        public BaseResponse CreateAnswer(ClientAnswerViewModel newAnswer)
        {
            newAnswer.PostedTime = DateTime.Now;
            var answer = AnswerApi.CreateAnswer(newAnswer);

            try
            {
                return(new BaseResponse()
                {
                    Data = answer,
                    StatusCode = (int)HttpStatusCode.OK
                });
            }
            catch (Exception e)
            {
                return(new BaseResponse()
                {
                    Message = e.Message,
                    StatusCode = (int)HttpStatusCode.InternalServerError
                });
            }
        }