diff --git a/src/Web/Catalog.WebForms/Catalog.WebForms/Services/CatalogService.cs b/src/Web/Catalog.WebForms/Catalog.WebForms/Services/CatalogService.cs index 0a6339b3a..cc22a37c4 100644 --- a/src/Web/Catalog.WebForms/Catalog.WebForms/Services/CatalogService.cs +++ b/src/Web/Catalog.WebForms/Catalog.WebForms/Services/CatalogService.cs @@ -23,8 +23,8 @@ namespace eShopOnContainers.Core.Services.Catalog { try { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId); @@ -48,8 +48,8 @@ namespace eShopOnContainers.Core.Services.Catalog { try { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = "api/v1/catalog/items"; @@ -82,8 +82,8 @@ namespace eShopOnContainers.Core.Services.Catalog { try { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = "api/v1/catalog/catalogbrands"; @@ -107,8 +107,8 @@ namespace eShopOnContainers.Core.Services.Catalog { try { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = "api/v1/catalog/catalogtypes"; @@ -130,8 +130,8 @@ namespace eShopOnContainers.Core.Services.Catalog public Task DeleteCatalogItemAsync(string catalogItemId) { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = $"api/v1/catalog/{catalogItemId}"; @@ -142,8 +142,8 @@ namespace eShopOnContainers.Core.Services.Catalog public Task UpdateCatalogItemAsync(CatalogItem item) { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = "api/v1/catalog/edit"; @@ -154,8 +154,8 @@ namespace eShopOnContainers.Core.Services.Catalog public Task CreateCatalogItemAsync(CatalogItem item) { - // TODO: - UriBuilder builder = new UriBuilder("http://catalog.api:5101"); + var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"]; + UriBuilder builder = new UriBuilder(baseURl); builder.Path = "api/v1/catalog/create"; diff --git a/src/Web/Catalog.WebForms/Catalog.WebForms/Web.config b/src/Web/Catalog.WebForms/Catalog.WebForms/Web.config index 30a2748b0..0e2f9205e 100644 --- a/src/Web/Catalog.WebForms/Catalog.WebForms/Web.config +++ b/src/Web/Catalog.WebForms/Catalog.WebForms/Web.config @@ -10,6 +10,7 @@ +