Exemplo n.º 1
0
        public IActionResult Post([FromBody] OwnCommentModel model)
        {
            var owncomment = ModelFactory.Map(model);

            DataService.AddOwnComment(owncomment);
            return(Ok(ModelFactory.Map(owncomment, Url)));
        }
Exemplo n.º 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());
        }