Exemple #1
0
 protected async Task<bool> IsNewAsync(SourceModels.CountryFeature feature)
 {
     bool isNew = (
         await this.entitySet.Where(x =>
             (feature.GeoNameID != null && x.GeoNameID == feature.GeoNameID)
         ).CountAsync() > 0
     );
     return isNew;
 }
        public DestModels.Region Translate(SourceModels.CountryFeature feature, DestModels.Country parent)
        {
            if (!feature.IsRegion)
                return null;

            var record = new DestModels.Region();

            record.Name = feature.Name;
            record.GeoNameID = feature.GeoNameID;
            record.CountryID = parent.ID;

            return record;
        }
Exemple #3
0
        public DestModels.City Translate(SourceModels.CountryFeature feature, DestModels.Region parent)
        {
            if (!feature.IsCity)
                return null;

            var record = new DestModels.City();

            record.DisplayName = feature.Name;
            record.RegionID = parent.ID;
            record.Latitude = feature.Latitude;
            record.Longitude = feature.Longitude;
            record.Population = (uint)feature.Population;
            record.GeoNameID = feature.GeoNameID;

            return record;
        }
 public DestModels.Country Translate(SourceModels.Country source)
 {
     var newRecord = new DestModels.Country()
     {
         Name = source.CountryName,
         Continent = source.ContinentCode,
         CurrencyCode = source.CurrencyCode,
         GeoNameID = source.GeoNameID,
         ISO_A2 = source.ISO_A2,
         ISO_A3 = source.ISO_A3,
         ISO_Numeric = source.ISO_Numeric,
         PostalCodeFormat = source.PostalCodeFormat,
         PostalCodeRegex = source.PostalCodeRegex
     };
     return newRecord;
 }
Exemple #5
0
 protected bool IsNew(SourceModels.CountryFeature feature)
 {
     var task = this.IsNewAsync(feature);
     task.Wait();
     return task.Result;
 }
 protected bool IsNew(SourceModels.Country country)
 {
     var task = this.IsNewAsync(country);
     task.Wait();
     return task.Result;
 }