ListmyList = new List (); // Try to remove an item from an empty list int itemToRemove = myList.RemoveAt(0); // throws InvalidOperationException exception
try { // Update a record db.UpdateRecord(newRecord); } catch (DbUpdateConcurrencyException ex) { throw new InvalidOperationException("The record being updated no longer exists.", ex); }Package library: System.Runtime.dll