Example #1
0
 public Artist Add(Artist item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     item.Id = _nextId++;
     artists.Add(item);
     return item;
 }
Example #2
0
 public bool Update(Artist item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     int index = artists.FindIndex(p => p.Id == item.Id);
     if (index == -1)
     {
         return false;
     }
     artists.RemoveAt(index);
     artists.Add(item);
     return true;
 }