public Address Convert(AddressDTO source, Address destination, ResolutionContext context) { if (source != null) { return(Task.Run(async() => await _addressRepository.EnsureAsync ( new Address { AppartementBus = source.AppartementBus, HouseNumber = source.HouseNumber, Country = new Country { Name = source.Country }, Street = new Street { Name = source.Street }, ZIP = new ZIP { Code = source.ZIP } } ) ).Result); } throw new ArgumentNullException("The data from the address was invalid, please check the formatting. If you believe this is an error, contact the administrator."); }