Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public virtual bool Delete(object key)
        {
            var sql = SqlDeleteGenerator.GetDelete();

            using (var connection = DbConnectionFactory.CreateConnection())
            {
                connection.Open();
                return(connection.Execute(sql, key) > 0);
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public virtual async Task <bool> DeleteAsync(object key)
        {
            var sql = SqlDeleteGenerator.GetDelete();

            using (var connection = DbConnectionFactory.CreateConnection())
            {
                connection.Open();
                await connection.QueryAsync <int>(sql, key);

                return(true);
            }
        }