Пример #1
0
 public static Comment ToModel(this CommentAddEditViewModel comment)
 {
     return(new Comment
     {
         Content = comment.Content,
         ID = comment.ID,
         TicketID = comment.TicketID,
         UserID = comment.UserID
     });
 }
 public async Task <int> CreateAsync(CommentAddEditViewModel ticket)
 {
     return(await _comment.Create(ticket.ToModel()));
 }
        public async Task <IActionResult> Create(CommentAddEditViewModel comment)
        {
            var result = await _commentService.CreateAsync(comment);

            return(CreatedAtAction(nameof(GetByID), new { id = result }, comment));
        }