public static void DeletePerson(int id)
{
lock (lockObj)
{
var persons = TestPerson.Storage;
TestPerson person = null;
foreach (TestPerson p in persons)
{
if (p.Id == id)
{
person = p;
break;
}
}
if (person == null)
{
throw new Exception("TestPerson not found");
}
persons.Remove(person);
TestPerson.Storage = persons;
}
}