Esempio n. 1
0
        /// <param name="guid"> guid </param>
        public async Task <IGeoZone> FetchGeoZone(Guid guid)
        {
            using (DbDataReader reader = await dbGeoZone.GetOne(guid))
            {
                if (reader.Read())
                {
                    GeoZone geoZone = new GeoZone();
                    geoZone.Guid        = new Guid(reader["Guid"].ToString());
                    geoZone.CountryGuid = new Guid(reader["CountryGuid"].ToString());
                    geoZone.Name        = reader["Name"].ToString();
                    geoZone.Code        = reader["Code"].ToString();

                    return(geoZone);
                }
            }

            return(null);
        }
Esempio n. 2
0
        /// <param name="guid"> guid </param>
        public async Task <IGeoZone> FetchGeoZone(Guid guid, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            using (DbDataReader reader = await dbGeoZone.GetOne(guid))
            {
                if (reader.Read())
                {
                    GeoZone geoZone = new GeoZone();
                    geoZone.Guid        = new Guid(reader["Guid"].ToString());
                    geoZone.CountryGuid = new Guid(reader["CountryGuid"].ToString());
                    geoZone.Name        = reader["Name"].ToString();
                    geoZone.Code        = reader["Code"].ToString();

                    return(geoZone);
                }
            }

            return(null);
        }