Ejemplo n.º 1
0
        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
            var predicateMember = "";

            foreach (var o in args)
            {
                if (predicateMember != "")
                {
                    predicateMember += ",";
                }
                if (o is String)
                {
                    predicateMember += @"'" + o + @"'";
                }
                else
                if (o is Boolean)
                {
                    predicateMember += ((bool)o).ToSQLBitField();
                }
                else
                {
                    predicateMember += o;
                }
            }

            result = new SqlStatementFragment(String.Format("{0} {1} ({2})", StatementFragement, binder.Name, predicateMember));
            return(true);
        }
Ejemplo n.º 2
0
        public override bool TryGetMember(
            GetMemberBinder binder, out object result)
        {
            string name = binder.Name.ToLower();

            if (!InnerDictionary.TryGetValue(name, out result))
            {
                result = new SqlStatementFragment(ToString() + ' ' + binder.Name);
                return(true);
            }
            return(InnerDictionary.TryGetValue(name, out result));
        }