public void AddResident(Resident resident) { if (resident != null) { foreach (var res in _residents) { if (res.ToString().Equals(resident.ToString())) { AddNotification("Resident", $"Morador {resident.ToString()} já existe"); return; } } _residents.Add(resident); resident.AddApartment(this); Updated = DateTime.Now; } }
public void RemoveResident(Resident resident) { _residents.Remove(resident); Updated = DateTime.Now; }