public async Task <IActionResult> Get(Guid postId) { if (postId == Guid.Empty) { ModelState.AddModelError(nameof(postId), "value is empty"); return(BadRequest(ModelState.CombineErrorMessages())); } var(hits, likes) = await _statistics.GetStatisticAsync(postId); return(Ok(new { Hits = hits, Likes = likes })); }
public async Task <IActionResult> Get([NotEmpty] Guid postId) { var(hits, likes) = await _statistics.GetStatisticAsync(postId); return(Ok(new { Hits = hits, Likes = likes })); }