/*-----------------Function to replace the instance of the value----------------------*/ public bool replaceValueInstance(Key key, Value val) { try { if (db.Contains(key)) { db.saveValue(key, val); return(true); } else { WriteLine("\nKey is not present in the dictionary\n"); return(false); } } catch (Exception e) { Console.WriteLine(e.Message.ToString()); return(false); } }