示例#1
0
        protected IDeleteBuilder BuilderParse(ParamDelete param)
        {
            var data          = param.GetData();
            var from          = data.From.Length == 0 ? typeof(T).Name : data.From;
            var deleteBuilder = db.Delete(from);

            var where = GetSqlWhere(data.Where);
            if (data.Where.Exists(x => x.Symbol != "equal"))
            {
                foreach (var c in data.Where.Where(x => x.Symbol != "eqaul" && x.Parameters != null && x.Parameters.Count > 0))
                {
                    throw new Exception(string.Format("删除条件中的{0}未实现参数化!", c.Symbol));
                }

                deleteBuilder.Where(where);
            }
            else
            {
                foreach (var c in data.Where)
                {
                    deleteBuilder.Where(c.Column, c.Values[0]);
                }
            }

            return(deleteBuilder);
        }
示例#2
0
        protected IDeleteBuilder BuilderParse(ParamDelete param)
        {
            var data          = param.GetData();
            var deleteBuilder = db.Delete(data.From.Length == 0 ? typeof(T).Name : data.From);

            deleteBuilder.Where(data.WhereSql);

            return(deleteBuilder);
        }