Removing pokemon catches. #75
This commit is contained in:
parent
12a734380c
commit
485e8faf03
@ -9,19 +9,13 @@ namespace eShopOnContainers.Core.Extensions
|
||||
{
|
||||
ObservableCollection<T> collection = new ObservableCollection<T>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (T item in source)
|
||||
{
|
||||
collection.Add(item);
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return collection;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -17,8 +17,7 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
|
||||
public async Task<CustomerBasket> GetBasketAsync(string guidUser, string token)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint);
|
||||
|
||||
builder.Path = guidUser;
|
||||
@ -31,20 +30,10 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
ServicesHelper.FixBasketItemPictureUri(basket?.Items);
|
||||
|
||||
return basket;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new CustomerBasket
|
||||
{
|
||||
BuyerId = guidUser,
|
||||
Items = new System.Collections.Generic.List<BasketItem>()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<CustomerBasket> UpdateBasketAsync(CustomerBasket customerBasket, string token)
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint);
|
||||
|
||||
@ -54,11 +43,6 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
|
||||
return result;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new CustomerBasket();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ClearBasketAsync(string guidUser, string token)
|
||||
{
|
||||
|
@ -20,8 +20,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> FilterAsync(int catalogBrandId, int catalogTypeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||
@ -35,17 +34,12 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
return catalog?.Data.ToObservableCollection();
|
||||
else
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/items";
|
||||
@ -63,11 +57,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
}
|
||||
else
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Task<CatalogItem> GetCatalogItemAsync(string id)
|
||||
@ -77,8 +67,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogbrands";
|
||||
@ -92,17 +81,12 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
return brands?.ToObservableCollection();
|
||||
else
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogtypes";
|
||||
@ -116,11 +100,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
return types.ToObservableCollection();
|
||||
else
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,7 @@ namespace eShopOnContainers.Core.Services.Order
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync(string token)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders";
|
||||
@ -39,11 +38,7 @@ namespace eShopOnContainers.Core.Services.Order
|
||||
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.Order>>(uri, token);
|
||||
|
||||
return orders;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<Models.Orders.Order>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async Task<Models.Orders.Order> GetOrderAsync(int orderId, string token)
|
||||
|
@ -16,8 +16,7 @@ namespace eShopOnContainers.Core.Services.User
|
||||
|
||||
public async Task<UserInfo> GetUserInfoAsync(string authToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.UserInfoEndpoint);
|
||||
|
||||
string uri = builder.ToString();
|
||||
@ -26,11 +25,7 @@ namespace eShopOnContainers.Core.Services.User
|
||||
await _requestProvider.GetAsync<UserInfo>(uri, authToken);
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new UserInfo();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -7,22 +7,14 @@ namespace eShopOnContainers.Core.Extensions
|
||||
{
|
||||
public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> source)
|
||||
{
|
||||
ObservableCollection<T> collection = new ObservableCollection<T>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (T item in source)
|
||||
{
|
||||
collection.Add(item);
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
// Really?
|
||||
catch
|
||||
{
|
||||
return collection;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -21,8 +21,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> FilterAsync(int catalogBrandId, int catalogTypeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// TODO:
|
||||
UriBuilder builder = new UriBuilder("" /* GlobalSetting.Instance.CatalogEndpoint */);
|
||||
|
||||
@ -37,17 +36,13 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
return catalog?.Data.ToObservableCollection();
|
||||
else
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// TODO:
|
||||
UriBuilder builder = new UriBuilder("" /* GlobalSetting.Instance.CatalogEndpoint */);
|
||||
|
||||
@ -66,11 +61,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
}
|
||||
else
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Task<CatalogItem> GetCatalogItemAsync(string id)
|
||||
@ -80,8 +71,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// TODO:
|
||||
UriBuilder builder = new UriBuilder("" /* GlobalSetting.Instance.CatalogEndpoint */);
|
||||
|
||||
@ -97,16 +87,10 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
else
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// TODO:
|
||||
UriBuilder builder = new UriBuilder("" /* GlobalSetting.Instance.CatalogEndpoint */);
|
||||
|
||||
@ -121,11 +105,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
return types.ToObservableCollection();
|
||||
else
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user