예제 #1
0
        public IActionResult Post([FromBody] OwnCommentModel model)
        {
            var owncomment = ModelFactory.Map(model);

            DataService.AddOwnComment(owncomment);
            return(Ok(ModelFactory.Map(owncomment, Url)));
        }
예제 #2
0
        public IActionResult Put(int id, [FromBody] OwnCommentModel model)
        {
            var own = ModelFactory.Map(model);

            own.CommentId = id;
            if (!DataService.UpdateOwnComment(own))
            {
                return(NotFound());
            }
            return(Ok());
        }