public IActionResult Create([FromBody] CreateReplyViewModel postReplyToCreate) { var reply = new PostReply(); var identity = (ClaimsIdentity)User.Identity; IEnumerable <Claim> claims = identity.Claims; reply.Content = postReplyToCreate.Content; reply.Post.Id = postReplyToCreate.PostId; reply.User.Id = int.Parse(claims.ElementAt(2).Value); _postReply.Create(reply); return(View()); }
public void Create(PostReply postReply) { _context.Create(postReply); }