public static void TestSitefinityApiAccess() { var sitefinityBaseUrl = MigrationSettings.Settings.SitefinityBaseUrl; var sitefinityUsername = MigrationSettings.Settings.SitefinityUsername; var sitefinityPassword = MigrationSettings.Settings.SitefinityPassword; using (var sf = new SitefinityRestClient(sitefinityUsername, sitefinityPassword, sitefinityBaseUrl)) { var local = new LocalizationCulturesServiceWrapper(sf); local.GetCultures("", 0, int.MaxValue, "", ""); } }
private void GetCatalogCultures(SitefinityCatalogCurrencyCulture catalog, SitefinityRestClient sf) { var localizationWrapper = new LocalizationCulturesServiceWrapper(sf); var availableCultures = localizationWrapper.GetCultures("", 0, int.MaxValue, "", ""); if (!availableCultures.Items.Any()) { Log.Error("No cultures returned from Sitefinity"); throw new MigrationException("There must be at least one culture to import from Sitefinity"); } catalog.Cultures = availableCultures.Items.ToList(); }