// -----------------------------------------------------------------------------

        // Dispose method came from using code generation.
        // not really sure what it does.
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                db.Dispose();
            }
            base.Dispose(disposing);
        }