private static void ApplyCustomFieldParameter(QueryParameter parameter, bool inner, FieldType fieldType, IUnitOfWork unitOfWork)
        {
            var parts = parameter.Name.Split('_', 4);
            var field = new CustomField {
                Name = parts[3], Namespace = parts[2], Type = fieldType
            };

            if (parameter.Values.Length > 1)
            {
                if (!parameter.Name.StartsWith("EQ_"))
                {
                    throw new EpcisException(ExceptionType.QueryParameterException, "Custom Field parameter must be 'EQ' if multiple values are present.");
                }
                unitOfWork.EventManager.WhereCustomFieldMatches(field, inner, parameter.Values);
            }
            else
            {
                var filterOperator = Enumeration.GetByDisplayName <FilterComparator>(parameter.Name.Substring(0, 2));
                unitOfWork.EventManager.WhereCustomFieldMatches(field, inner, filterOperator, parameter.GetSingleValue());
            }
        }
 public static bool ContainsSingleValueOfType(this QueryParameter parameter, params Type[] types)
 {
     return(parameter.Values.Length == 1 && types.Contains(parameter.GetSingleValue().GetType()));
 }