/// <summary>
        /// Combine an "and" compound filter with the two filters
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="fragments"></param>
        /// <returns></returns>
        public static ISqlFragment CombineAnd(this ISqlFragment filter, ISqlFragment other)
        {
            if (filter is CompoundWhereFragment c && c.Separator.EqualsIgnoreCase("and"))
            {
                c.Add(other);
                return(c);
            }

            return(CompoundWhereFragment.And(filter, other));
        }
        /// <summary>
        /// If extras has any items, return an "and" compound fragment. Otherwise return the original filter
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="fragments"></param>
        /// <returns></returns>
        public static ISqlFragment CombineAnd(this ISqlFragment filter, IReadOnlyList <ISqlFragment> extras)
        {
            if (extras.Any())
            {
                if (filter is CompoundWhereFragment c && c.Separator.EqualsIgnoreCase("and"))
                {
                    c.Add(extras);
                    return(c);
                }

                var compound = CompoundWhereFragment.And(extras);
                compound.Add(filter);

                return(compound);
            }

            return(filter);
        }