예제 #1
0
 private Task <bool> UpdateAlgoliaExports(PlaceDetail currentPlace, AlgoliaExport currentAlgoliaObject)
 {
     currentAlgoliaObject.Name          = currentPlace.Name;
     currentAlgoliaObject.Description   = currentPlace.EventDescription;
     currentAlgoliaObject.State         = currentPlace.StateName;
     currentAlgoliaObject.Country       = currentPlace.CountryName;
     currentAlgoliaObject.City          = currentPlace.CityName;
     currentAlgoliaObject.Category      = currentPlace.ParentCategory;
     currentAlgoliaObject.SubCategory   = currentPlace.Category;
     currentAlgoliaObject.Url           = currentPlace.Url;
     currentAlgoliaObject.PlaceImageUrl = "https://static1.feelaplace.com/images/places/tiles/" + currentPlace.AltId.ToString().ToUpper() + "-ht-c1.jpg";
     currentAlgoliaObject.IsEnabled     = true;
     currentAlgoliaObject.IsIndexed     = true;
     currentAlgoliaObject.CityId        = currentPlace.CityId;
     currentAlgoliaObject.CountryId     = currentPlace.CountryId;
     currentAlgoliaObject.StateId       = currentPlace.StateId;
     _algoliaExportRepositoryRepository.Save(currentAlgoliaObject);
     return(Task.FromResult(true));
 }
예제 #2
0
        private bool ShouldInsert(AlgoliaExport algoliaExportModel, PlaceDetail eventDetailModel)
        {
            if (algoliaExportModel != null && (algoliaExportModel.Name != eventDetailModel.Name ||
                                               algoliaExportModel.Description != eventDetailModel.EventDescription ||
                                               algoliaExportModel.Category != eventDetailModel.ParentCategory ||
                                               algoliaExportModel.SubCategory != eventDetailModel.Category ||
                                               algoliaExportModel.City != eventDetailModel.CityName ||
                                               algoliaExportModel.State != eventDetailModel.StateName ||
                                               algoliaExportModel.Country != eventDetailModel.CountryName ||
                                               algoliaExportModel.CityId != eventDetailModel.CityId ||
                                               algoliaExportModel.StateId != eventDetailModel.StateId ||
                                               algoliaExportModel.CountryId != eventDetailModel.CountryId ||
                                               algoliaExportModel.Url != eventDetailModel.Url
                                               ))

            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
        private bool CheckForUpdate(AlgoliaExport currentAlgoliaObject, PlaceDetail currentPlace)
        {
            if (currentAlgoliaObject.Name != currentPlace.Name ||
                currentAlgoliaObject.Description != currentPlace.EventDescription ||
                currentAlgoliaObject.Category != currentPlace.ParentCategory ||
                currentAlgoliaObject.SubCategory != currentPlace.Category ||
                currentAlgoliaObject.City != currentPlace.CityName ||
                currentAlgoliaObject.State != currentPlace.StateName ||
                currentAlgoliaObject.Country != currentPlace.CountryName ||
                currentAlgoliaObject.CityId != currentPlace.CityId ||
                currentAlgoliaObject.StateId != currentPlace.StateId ||
                currentAlgoliaObject.CountryId != currentPlace.CountryId ||
                currentAlgoliaObject.Url != currentPlace.Url
                )

            {
                return(true);
            }
            else
            {
                return(false);
            }
        }