Beispiel #1
0
        public tgCase When(object value)
        {
            this.WhenItem            = new tgExpressionOrComparison();
            this.WhenItem.Expression = new tgExpression();
            this.WhenItem.Expression.LiteralValue = value;

            return(this);
        }
Beispiel #2
0
        public tgCase When(tgComparison comparison)
        {
            this.WhenItem             = new tgExpressionOrComparison();
            this.WhenItem.Comparisons = new List <tgComparison>();

            if (comparison != null)
            {
                if (comparison.data.WhereExpression != null)
                {
                    foreach (tgComparison exp in comparison.data.WhereExpression)
                    {
                        tgDynamicQuerySerializable q = exp.Value as tgDynamicQuerySerializable;

                        if (q != null)
                        {
                            IDynamicQuerySerializableInternal iQ = q as IDynamicQuerySerializableInternal;
                            iQ.HookupProviderMetadata(q);
                        }
                    }

                    this.WhenItem.Comparisons.AddRange(comparison.data.WhereExpression);
                }
                else
                {
                    this.WhenItem.Comparisons.Add(comparison);
                }

                tgDynamicQuerySerializable query = comparison.Value as tgDynamicQuerySerializable;

                if (query != null)
                {
                    IDynamicQuerySerializableInternal iQ = query as IDynamicQuerySerializableInternal;
                    iQ.HookupProviderMetadata(query);
                }
            }

            return(this);
        }
Beispiel #3
0
        public tgCase When(tgComparison comparison)
        {
            this.WhenItem = new tgExpressionOrComparison();
            this.WhenItem.Comparisons = new List<tgComparison>();

            if (comparison != null)
            {
                if (comparison.data.WhereExpression != null)
                {
                    foreach (tgComparison exp in comparison.data.WhereExpression)
                    {
                        tgDynamicQuerySerializable q = exp.Value as tgDynamicQuerySerializable;

                        if (q != null)
                        {
                            IDynamicQuerySerializableInternal iQ = q as IDynamicQuerySerializableInternal;
                            iQ.HookupProviderMetadata(q);
                        }
                    }

                    this.WhenItem.Comparisons.AddRange(comparison.data.WhereExpression);
                }
                else
                {
                    this.WhenItem.Comparisons.Add(comparison);
                }

                tgDynamicQuerySerializable query = comparison.Value as tgDynamicQuerySerializable;

                if (query != null)
                {
                    IDynamicQuerySerializableInternal iQ = query as IDynamicQuerySerializableInternal;
                    iQ.HookupProviderMetadata(query);
                }
            }

            return this;
        }
Beispiel #4
0
        public tgCase When(object value)
        {
            this.WhenItem = new tgExpressionOrComparison();
            this.WhenItem.Expression = new tgExpression();
            this.WhenItem.Expression.LiteralValue = value;

            return this;
        }