public void Add(Client client) { _repositoryClient.Add(client); if (client.Addresses.Any()) { foreach (var address in client.Addresses) { address.SetClient(client.Id); _serviceAddress.Add(address); } } if (client.Contacts.Any()) { foreach (var contact in client.Contacts) { contact.SetClient(client.Id); _serviceContact.Add(contact); } } }
public async Task <bool> Add(Client client) { return(await _repositoryClient.Add(client)); }