public IActionResult GetLikes(int id) { var repo = new PostsRepository(_connectionString); var post = repo.GetById(id); post.Likes = repo.GetLikesCount(id); return(Json(post)); }