public bool SaveContact(Contact currentContact) { if (this.Store.Any(item => item.Roll == currentContact.Roll)) return false; this.Store.Add(currentContact); return true; }
public bool UpdateContacts(Contact contact) { var currentContact = this.Store.FirstOrDefault(e => e.Roll == contact.Roll); if (currentContact != null) { currentContact.Name = contact.Name; currentContact.Age = contact.Age; currentContact.Address = contact.Address; return true; } return false; }