Esempio n. 1
0
 public void Create(MailModel toUpdate)
 {
     foreach (MailModel model in mailList)
     {
         if (model.Id == toUpdate.Id)
         {
             throw new System.InvalidOperationException("Duplicate id: " + model.Id);
         }
     }
     mailList.Add(toUpdate);
 }
Esempio n. 2
0
 public void Update(MailModel toUpdate)
 {
     foreach (MailModel model in mailList)
     {
         if (model.Id == toUpdate.Id)
         {
             mailList.Remove(model);
             mailList.Add(toUpdate);
             break;
         }
     }
 }