private List <StringCompareOperator> GetStringCompareOperator(DyntaxaStringCompareOperator compareOperator)
        {
            switch (compareOperator)
            {
            case DyntaxaStringCompareOperator.BeginsWith:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.BeginsWith
                });

            case DyntaxaStringCompareOperator.Contains:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.Contains
                });

            case DyntaxaStringCompareOperator.EndsWith:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.EndsWith
                });

            case DyntaxaStringCompareOperator.Equal:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.Equal
                });

            case DyntaxaStringCompareOperator.Iterative:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.Equal, StringCompareOperator.BeginsWith, StringCompareOperator.Contains
                });

            case DyntaxaStringCompareOperator.Like:
                return(new List <StringCompareOperator> {
                    StringCompareOperator.Like
                });

            default:
                return(null);
            }
        }
        public SelectList CreateCompareOperatorSelectlist(DyntaxaStringCompareOperator?op)
        {
            const DyntaxaStringCompareOperator defaultOperator = DyntaxaStringCompareOperator.Contains;

            return(new SelectList(
                       new[]
            {
                new SelectListItem()
                {
                    Text = Labels.CompareOpBeginsWithLabel, Value = DyntaxaStringCompareOperator.BeginsWith.ToString()
                },
                new SelectListItem()
                {
                    Text = Labels.CompareOpContainsLabel, Value = DyntaxaStringCompareOperator.Contains.ToString()
                },
                new SelectListItem()
                {
                    Text = Labels.CompareOpEndsWithLabel, Value = DyntaxaStringCompareOperator.EndsWith.ToString()
                },
                new SelectListItem()
                {
                    Text = Labels.CompareOpEqualLabel, Value = DyntaxaStringCompareOperator.Equal.ToString()
                },
                new SelectListItem()
                {
                    Text = Labels.CompareOpIterativeLabel, Value = DyntaxaStringCompareOperator.Iterative.ToString()
                },
                new SelectListItem()
                {
                    Text = Labels.CompareOpLikeLabel, Value = DyntaxaStringCompareOperator.Like.ToString()
                },
            },
                       "Value",
                       "Text",
                       op.HasValue ? op.Value.ToString() : defaultOperator.ToString()));
        }