public async Task AddComment([FromBody] CreateCommentDto request) { request.UserId = User.GetUserId(); request.UserName = User.GetUserName(); await _advertCommentService.AddAsync(request); }
public async Task <IActionResult> AddComment([FromForm] CreateCommentDto comment) { //логика добавления комментария await _commentService.AddAsync(comment); return(RedirectToAction("Get", "Advert", new { id = comment.AdvertId })); }