public void Update(Client client)
        {
            try
            {
                if (!ClientValidator.IsValid(client))
                {
                    throw new InvalidOperationException();
                }

                var existing = _ctx.Clients.FirstOrDefault(c => c.CPF == client.CPF);

                if (existing == null)
                {
                    _ctx.Clients.Add(client);
                }
                else
                {
                    existing.Name          = client.Name;
                    existing.Email         = client.Email;
                    existing.MaritalStatus = client.MaritalStatus;
                    existing.PhoneNumbers  = client.PhoneNumbers;
                    existing.Street        = client.Street;
                    existing.City          = client.City;
                    existing.State         = client.State;
                    existing.Country       = client.Country;
                    existing.Zip           = client.Zip;
                }

                _ctx.SaveChanges();
            }
            catch (InvalidOperationException)
            {
                throw new InvalidOperationException("Invalid client");
            }
            catch (Exception)
            {
                throw new ApplicationException("The data couldn't be saved.");
            }
        }