public async Task <IGeoCountry> FetchCountry(string isoCode2) { using (DbDataReader reader = await dbGeoCountry.GetByISOCode2(isoCode2)) { if (reader.Read()) { GeoCountry geoCountry = new GeoCountry(); LoadFromReader(reader, geoCountry); return(geoCountry); } } return(null); }
public async Task <IGeoCountry> FetchCountry(string isoCode2, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); using (DbDataReader reader = await dbGeoCountry.GetByISOCode2(isoCode2)) { if (reader.Read()) { GeoCountry geoCountry = new GeoCountry(); LoadFromReader(reader, geoCountry); return(geoCountry); } } return(null); }