public List<ViewCount> Get(int postId)
{
var viewCounts = new List<ViewCount>();
try
{
var db = _viewCountRepository.Find(a => a.PostId == postId, true).ToList();
db.ForEach(a => viewCounts.Add(ViewCountMapper.ToDto(a)));
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
return viewCounts;
}