read catalog API from web config
Instead of hard coding.
This commit is contained in:
parent
7daf4c0455
commit
7c559dd298
@ -23,8 +23,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||||
|
|
||||||
@ -48,8 +48,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = "api/v1/catalog/items";
|
builder.Path = "api/v1/catalog/items";
|
||||||
|
|
||||||
@ -82,8 +82,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = "api/v1/catalog/catalogbrands";
|
builder.Path = "api/v1/catalog/catalogbrands";
|
||||||
|
|
||||||
@ -107,8 +107,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = "api/v1/catalog/catalogtypes";
|
builder.Path = "api/v1/catalog/catalogtypes";
|
||||||
|
|
||||||
@ -130,8 +130,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
|
|
||||||
public Task DeleteCatalogItemAsync(string catalogItemId)
|
public Task DeleteCatalogItemAsync(string catalogItemId)
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = $"api/v1/catalog/{catalogItemId}";
|
builder.Path = $"api/v1/catalog/{catalogItemId}";
|
||||||
|
|
||||||
@ -142,8 +142,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
|
|
||||||
public Task<CatalogItem> UpdateCatalogItemAsync(CatalogItem item)
|
public Task<CatalogItem> UpdateCatalogItemAsync(CatalogItem item)
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = "api/v1/catalog/edit";
|
builder.Path = "api/v1/catalog/edit";
|
||||||
|
|
||||||
@ -154,8 +154,8 @@ namespace eShopOnContainers.Core.Services.Catalog
|
|||||||
|
|
||||||
public Task<CatalogItem> CreateCatalogItemAsync(CatalogItem item)
|
public Task<CatalogItem> CreateCatalogItemAsync(CatalogItem item)
|
||||||
{
|
{
|
||||||
// TODO:
|
var baseURl = System.Configuration.ConfigurationManager.AppSettings["CatalogURL"];
|
||||||
UriBuilder builder = new UriBuilder("http://catalog.api:5101");
|
UriBuilder builder = new UriBuilder(baseURl);
|
||||||
|
|
||||||
builder.Path = "api/v1/catalog/create";
|
builder.Path = "api/v1/catalog/create";
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
</configSections>
|
</configSections>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="usefake" value="false" />
|
<add key="usefake" value="false" />
|
||||||
|
<add key ="CatalogURL" value="http://catalog.api:5101" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Catalog.WebForms-20170322110716.mdf;Initial Catalog=aspnet-Catalog.WebForms-20170322110716;Integrated Security=True" providerName="System.Data.SqlClient" />
|
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-Catalog.WebForms-20170322110716.mdf;Initial Catalog=aspnet-Catalog.WebForms-20170322110716;Integrated Security=True" providerName="System.Data.SqlClient" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user