public void Dispose()
        {
            if (_SystemInserter != null)
            {
                _SystemInserter.Dispose();
                _SystemInserter = null;
            }

            if (_BodyInserter != null)
            {
                _BodyInserter.Dispose();
                _BodyInserter = null;
            }

            if (_ScanInserter != null)
            {
                _ScanInserter.Dispose();
                _ScanInserter = null;
            }

            if (_ScanUpdater != null)
            {
                _ScanUpdater.Dispose();
                _ScanUpdater = null;
            }

            if (_ScanHeaderInserter != null)
            {
                _ScanHeaderInserter.Dispose();
                _ScanHeaderInserter = null;
            }
        }
        public XDatabase SetContext(Models.BodyDbContext ctx)
        {
            _Context            = ctx;
            _SystemInserter     = new Models.DbSystemInserter(ctx);
            _BodyInserter       = new Models.DbBodyInserter(ctx);
            _ScanInserter       = new Models.DbScanInserter(ctx);
            _ScanHeaderInserter = new Models.DbScanHeaderInserter(ctx);
            _ScanUpdater        = new Models.DbScanUpdater(ctx);

            return(this);
        }