コード例 #1
0
        public void EqualToFilter()
        {
            var filter = new EqualToFilter("Name", "ShareFile");

            filter.ToString().Should().Be("Name eq 'ShareFile'");
        }
コード例 #2
0
            private IFilter CreateFilter(OperatorType operators, string propertyName, string propertyValue)
            {
                IFilter filter = null;
                switch (operators)
                {
                    case OperatorType.eq:
                        filter = new EqualToFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.ne:
                        filter = new NotEqualToFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.startswith:
                        filter = new StartsWithFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.endswith:
                        filter = new EndsWithFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.substringof:
                        filter = new SubstringFilter(propertyName, propertyValue);
                        break;
                    /* currently not supported
                    case OperatorType.lt:
                        filter = new LessThanFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.le:
                        filter = new LessThanOrEqualFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.gt:
                        filter = new GreaterThanFilter(propertyName, propertyValue);
                        break;
                    case OperatorType.ge:
                        filter = new GreaterThanOrEqualFilter(propertyName, propertyValue);
                        break;
                     */
                }

                return filter;
            }