Exemple #1
0
        public override SqlComputedString ToSql()
        {
            if (this.attributeModel == null)
            {
                if (this.attributePath != null)
                {
                    this.attributeModel = this.attributePath.ProcessElement(this.Owner);
                }
                else
                {
                    this.attributeModel = this.Owner.GetAttribute(attributeName);
                }
            }

            string qr = string.Format("{0} {1} @{2}", attributeModel.Mapping.ColumnName, OperatorProcessor.OperatorToString(this.operatorType), attributeModel.Mapping.AttributeName);
            Dictionary <string, object> sqlParams = new Dictionary <string, object>()
            {
                { "@" + attributeModel.Name, this.value }
            };


            return(new SqlComputedString(qr, sqlParams));
        }
 internal OperatorType(string name, OperatorProcessor processOperator)
 {
     this.Name = name;
     ProcessOperator = processOperator;
 }