Blog.Logic.Core.PostLikesLogic.Get C# (CSharp) Method

Get() public method

public Get ( int postId ) : List
postId int
return List
        public List<PostLike> Get(int postId)
        {
            var postLikes = new List<PostLike>();
            try
            {
                var db = _postLikeRepository.Find(a => a.PostId == postId, true).ToList();
                db.ForEach(a => postLikes.Add(PostLikeMapper.ToDto(a)));
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
            return postLikes;
        }