public async Task <CountryType> GetCountry([Parent] AirportType airport) { var country = (await _dataStore.FetchAllCountriesAsync()).FirstOrDefault(c => c.Name == airport.Country); return(country != null ? _mapper.Map <CountryType>(country) : new CountryType(airport.Country, null, null)); }
public async Task <CountryType> GetOrigin([Parent] AirlineType airline) { var countries = await _dataStore.FetchAllCountriesAsync(); return(_mapper.Map <CountryType>(countries.FirstOrDefault(c => c.Name == airline.Country))); }