コード例 #1
0
ファイル: Fixes.cs プロジェクト: alexidsa/civildoit
        //[Fact]
        public void RetrieveCasinoGeoPointIfItIsNotSet()
        {
            var documentStore = new DocumentStore() { ConnectionStringName = "Secure", Conventions = { DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites } };
            documentStore.Initialize();
            var documentSession = documentStore.OpenSession();

            var yandexGeolocationService = new YandexGeolocationService();

            var casinos = documentSession.Query<Casino>().ToList();

            foreach (var casino in casinos)
            {
                if (casino.GeoPoint == null || casino.GeoPoint.IsEmpty)
                {
                    var city = documentSession.Load<AdministrativeDivision>(casino.CityId);
                    var geoPoint = new GeoPoint(0, 0);
                    if (city != null)
                        geoPoint = yandexGeolocationService.GetPoint(city.Name, casino.Address);

                    casino.GeoPoint = geoPoint;
                    documentSession.Store(casino);
                }
            }
            documentSession.SaveChanges();
        }
コード例 #2
0
 public CasinoController(IDocumentIdRetriever documentIdRetriever, IExemptionItemTypeLocalizator exemptionItemTypeLocalizator, ExemptionsService exemptionsService, IExemptionItemTypeDropDownListLocalizator exemptionItemTypeDropDownListLocalizator, YandexGeolocationService yandexGeolocationService)
 {
     _documentIdRetriever = documentIdRetriever;
     _exemptionItemTypeLocalizator = exemptionItemTypeLocalizator;
     _exemptionsService = exemptionsService;
     _exemptionItemTypeDropDownListLocalizator = exemptionItemTypeDropDownListLocalizator;
     _yandexGeolocationService = yandexGeolocationService;
 }
コード例 #3
0
 public SalePointController(YandexGeolocationService yandexGeolocationService)
 {
     _yandexGeolocationService = yandexGeolocationService;
 }