Пример #1
0
        //protected IDeleteBuilder BuilderParse(ParamDelete param)
        //{
        //    var data = param.GetData();
        //    var deleteBuilder = db.Delete(data.From.Length == 0 ? typeof(T).Name : data.From);

        //    //todo wdz
        //    deleteBuilder.Where(data.WhereSql);
        //    //deleteBuilder.Where(data.Where[0].Data.Column,data.Where[0].Data.Value);

        //    var tableName = data.From.Length == 0 ? typeof (T).Name : data.From;
        //    string delSql = string.Format("DELETE FROM {0} WHERE {1}", tableName, data.WhereSql);
        //    return deleteBuilder;
        //}

        protected string BuilderDelSql(ParamDelete param)
        {
            var    data      = param.GetData();
            var    tableName = data.From.Length == 0 ? typeof(T).Name : data.From;
            string delSql    = string.Format("DELETE FROM {0} WHERE {1}", tableName, data.WhereSql);

            return(delSql);
        }
Пример #2
0
        public ParamDelete ToParamDelete()
        {
            var settings = XElement.Parse(settingXml);
            var pDelete  = ParamDelete.Instance().From(getXmlElementValue(settings, "table"));

            ParseWhere(settings, (name, value, compare, variable, extend) => pDelete.AndWhere(name, value, compare, extend));

            return(pDelete);
        }