public Person addPerson(string lastname, string firstname, PersonType type) { Person unePersonne = new Person { Date = DateTime.Now, LastName = lastname, FirstName = firstname, PersonType = type, HasSubscribed = false }; _persons.Add(unePersonne); return unePersonne; }
/*Must change the boolean property of the Person in your list to true*/ public bool Subscribe(Person p) { try { Person newPerson = _persons.Find(pe => pe.FirstName.ToLowerInvariant() == p.FirstName && pe.LastName.ToLowerInvariant() == p.LastName); if (newPerson==null) { return false; } newPerson.HasSubscribed = true; return true; } catch (Exception) { return false; } }