Formatting changes.

This commit is contained in:
David Britch 2017-04-19 17:08:53 +01:00
parent 00a44e1ea3
commit 6b97041d1d

View File

@ -20,7 +20,6 @@ namespace eShopOnContainers.Core.Services.Catalog
public async Task<ObservableCollection<CatalogItem>> FilterAsync(int catalogBrandId, int catalogTypeId)
{
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
@ -34,12 +33,10 @@ namespace eShopOnContainers.Core.Services.Catalog
return catalog?.Data.ToObservableCollection();
else
return new ObservableCollection<CatalogItem>();
}
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
{
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
builder.Path = "api/v1/catalog/items";
@ -57,31 +54,27 @@ namespace eShopOnContainers.Core.Services.Catalog
}
else
return new ObservableCollection<CatalogItem>();
}
public async Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
{
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
builder.Path = "api/v1/catalog/catalogbrands";
builder.Path = "api/v1/catalog/catalogbrands";
string uri = builder.ToString();
string uri = builder.ToString();
IEnumerable<CatalogBrand> brands =
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
if (brands != null)
return brands?.ToObservableCollection();
else
return new ObservableCollection<CatalogBrand>();
IEnumerable<CatalogBrand> brands =
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
if (brands != null)
return brands?.ToObservableCollection();
else
return new ObservableCollection<CatalogBrand>();
}
public async Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
{
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
builder.Path = "api/v1/catalog/catalogtypes";
@ -95,7 +88,6 @@ namespace eShopOnContainers.Core.Services.Catalog
return types.ToObservableCollection();
else
return new ObservableCollection<CatalogType>();
}
}
}