Blog.Logic.Core.CommentsLogic.SearchComments C# (CSharp) Method

SearchComments() public method

public SearchComments ( string query, int threshold = 10, int skip = 10 ) : List
query string
threshold int
skip int
return List
        public List<Comment> SearchComments(string query, int threshold = 10, int skip = 10)
        {
            var comments = new List<Comment>();
            try
            {
                var db = _commentRepository.SearchComments(query, threshold, skip).ToList();
                db.ForEach(a => comments.Add(CommentMapper.ToDto(a)));
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
            return comments;
        }