コード例 #1
0
        private string GetWhere(IList <Field> fields, FilterParameter filter)
        {
            StringBuilder sb       = new StringBuilder();
            string        template = "[{0}] {1} @{2}";

            foreach (Field field in fields)
            {
                sb.AppendFormat(template,
                                field.Name,
                                FilterOperatorToString(filter.Operator),
                                field.Name);
            }
            return(sb.ToString());
        }
コード例 #2
0
        private Field GetValueField(FilterParameter filter)
        {
            Property      property = GetPropertyByName(filter.Name);
            IList <Field> fields   = property.Fields;
            FieldPurpose  purpose  = FieldPurpose.Value;

            if (filter.Value == null || filter.Value is ReferenceObject)
            {
                purpose = FieldPurpose.Object;
            }
            foreach (Field field in fields)
            {
                if (field.Purpose == purpose)
                {
                    return(field);
                }
            }
            return(fields[0]);
        }