November Happy Hour will be moved to Thursday December 5th.

PrefixCaseInsensitive for strings collection

Vote:
 

Is it possible to use PrefixCaseInsensitive with a collection of strings?

By default, FIND allows to use MatchCaseInsensitive for strings collections but seems like PrefixCaseInsensitive is not supported. 

#203401
Apr 22, 2019 22:00
Vote:
 

I was able to achieve it using below code:

        public static DelegateFilterBuilder PrefixCaseInsensitive(this IEnumerable<string> value, string prefix)
        {
            return new DelegateFilterBuilder((Func<string, Filter>)(field => (Filter)new PrefixFilter(field, prefix.ToLowerInvariant())))
            {
                FieldNameMethod = (Func<Expression, IClientConventions, string>)((expression, conventions) => conventions.FieldNameConvention.GetFieldNameForLowercase(expression))
            };
        }

Thanks!

#203432
Apr 23, 2019 15:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.