Ejemplo n.º 1
0
 public Comment PutComment(CommentCandidate candidate)
 {
     return(new Comment
     {
         From = "PUT",
         PassedResult = candidate.Result
     });
 }
Ejemplo n.º 2
0
 public Comment PatchComment(CommentCandidate candidate)
 {
     return(new Comment
     {
         From = "PATCH",
         PassedResult = candidate.Result
     });
 }
Ejemplo n.º 3
0
        public IActionResult CreateComment(CommentCandidate candidate)
        {
            switch (candidate.Result)
            {
            case CommentCandidate.Success:
                return(this.Ok(new Comment
                {
                    From = "POST",
                    PassedResult = candidate.Result
                }));

            case CommentCandidate.BadRequest:
                return(this.BadRequest());

            case CommentCandidate.InternalServiceError:
                throw new NotImplementedException();

            default:
                throw new InvalidOperationException();
            }
        }