コード例 #1
0
        public int Remove(string id)
        {
            string command = _removeCommand.GetRemoveCommand();

            command += " Where Id = @id";
            return(_db.Execute(command, new { id }));
        }
コード例 #2
0
        public int RemeoveWithWhereClause(Expression <Predicate <T> > expression, object obj)
        {
            var    command     = removeCommand.GetRemoveCommand();
            var    bExp        = (BinaryExpression)expression.Body;
            var    name        = CheckBody(bExp);
            var    dView       = bExp.ToString();
            string whereClause = "";

            if (expression.Parameters.Count == 1)
            {
                whereClause = GenerateWhere.Generate(expression.Parameters[0].ToString(), dView);
            }
            command += " Where " + whereClause;
            return(_db.Execute(command, obj));
        }
コード例 #3
0
        public int RemoveAll()
        {
            string command = _removeCommand.GetRemoveCommand();

            return(_db.Execute(command));
        }