volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

PrefixCaseInsensitive for strings collection

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
error 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.