public bool Contains(string searchKeyword) { string lowerSearchKeyword = searchKeyword.ToLower(); return(Description.ToLower().Contains(lowerSearchKeyword) || WhenList.Any(when => when.ToLower().Contains(lowerSearchKeyword)) || ThenList.Any(then => then.Description.ToLower().Contains(lowerSearchKeyword)) || Children.Any(child => child.Contains(lowerSearchKeyword))); }
public bool IsEmpty() { return(!WhenList.Any() && !ThenList.Any() && Children.All(c => c.IsEmpty())); }