Beispiel #1
0
        public virtual string DeleteQuery(DeleteQuery query)
        {
            StringBuilder str = new StringBuilder();

            str.Append("DELETE ");

            str.Append(ModifiersQueryPart(query, true, true));

            str.Append("\n");

            str.Append(query.fromClause.ToString());
            str.Append("\n");

            str.Append(query.ConditionalQueryPart());

            return str.ToString();
        }
Beispiel #2
0
        /// <summary>
        /// Delete any rows from the DB that match the values of the given object.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj"></param>
        /// <returns>The number of rows affected</returns>
        public Task <NonQueryResult> Delete <T>(T obj)
        {
            DeleteQuery <T> query = new DeleteQuery <T>(Builder, obj);

            return(ExecuteNonQuery(query));
        }