Ejemplo n.º 1
0
        public ReturnMap <T> Add(Expression <Func <T, object> > expression, string columName)
        {
            string proCombineStr = Analyst.GetPropertyCombineStr(expression.Body);

            if (m_List.Exists(p => p.PropertyCombineStr == proCombineStr))
            {
                throw new ApplicationException("属性" + proCombineStr + "重复设置");
            }
            PropertyColumn pc = new PropertyColumn();

            pc.PropertyCombineStr = proCombineStr;
            pc.Column             = (columName == null || columName.Trim().Length <= 0) ? proCombineStr : columName;
            m_List.Add(pc);
            return(this);
        }
Ejemplo n.º 2
0
        public InputMap <T> Add(string parameterName, Expression <Func <T, object> > expression)
        {
            if (m_List.Exists(p => p.Parameter == parameterName))
            {
                throw new ApplicationException("SQL参数" + parameterName + "重复设置");
            }

            ParameterProperty <T> pc = new ParameterProperty <T>();

            pc.Parameter          = parameterName;
            pc.PropertyCombineStr = Analyst.GetPropertyCombineStr(expression.Body);
            //pc.PropertyGetter = expression.Compile();
            m_List.Add(pc);
            return(this);
        }