Ejemplo n.º 1
0
        public async Task <IActionResult> PostPost([FromBody] Post post)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            data.AddPost(post);
            data.commit();

            return(CreatedAtAction("GetPost", new { id = post.ID }, post));
        }