コード例 #1
0
        public IHttpActionResult Post(CommentsRequestModel model)
        {
            var userId = this.User.Identity.GetUserId();

            if (!this.ModelState.IsValid)
            {
                return(this.BadRequest());
            }

            var addedComment = this.comments.Add(Mapper.Map <Comment>(model), userId);

            return(this.Ok(Mapper.Map <CommentResponseModel>(addedComment)));
        }
コード例 #2
0
        public IHttpActionResult Post(CommentsRequestModel request)
        {
            var comment = this.commentsServices.Add(request.RealEstateId, request.Content);

            return(this.Ok(comment));
        }
コード例 #3
0
        public IHttpActionResult Post(CommentsRequestModel request)
        {
            var comment = this.commentsServices.Add(request.RealEstateId, request.Content);

            return this.Ok(comment);
        }