Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 public void Create(PostReply postReply)
 {
     _context.Create(postReply);
 }