protected override void ProcessRecord() { counter++; if (counter >= maxViews) { return; } using (var db = new CommenceDatabase()) // we could move this to BeginProcessing? Do we care? { dbName = db.Name; if (!db.ShowView(this.Name, newCopy)) { throw new InvalidOperationException($"Unable to open view '{this.Name}' in Commence."); } } }