diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/BasketController.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/BasketController.cs index 9f39cdd6d..a3cf4f03c 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/BasketController.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/BasketController.cs @@ -26,8 +26,7 @@ public class BasketController : ControllerBase } // Retrieve the current basket - var basket = await _basket.GetById(data.BuyerId) ?? new BasketData(data.BuyerId); - + var basket = await _basket.GetByIdAsync(data.BuyerId) ?? new BasketData(data.BuyerId); var catalogItems = await _catalog.GetCatalogItemsAsync(data.Items.Select(x => x.ProductId)); // group by product id to avoid duplicates var itemsCalculated = data @@ -84,7 +83,7 @@ public class BasketController : ControllerBase } // Retrieve the current basket - var currentBasket = await _basket.GetById(data.BasketId); + var currentBasket = await _basket.GetByIdAsync(data.BasketId); if (currentBasket == null) { return BadRequest($"Basket with id {data.BasketId} not found."); @@ -126,7 +125,7 @@ public class BasketController : ControllerBase //item.PictureUri = // Step 2: Get current basket status - var currentBasket = (await _basket.GetById(data.BasketId)) ?? new BasketData(data.BasketId); + var currentBasket = (await _basket.GetByIdAsync(data.BasketId)) ?? new BasketData(data.BasketId); // Step 3: Merge current status with new product currentBasket.Items.Add(new BasketDataItem() { diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/OrderController.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/OrderController.cs index 2203db664..55b4dd70b 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/OrderController.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/OrderController.cs @@ -25,7 +25,7 @@ public class OrderController : ControllerBase return BadRequest("Need a valid basketid"); } // Get the basket data and build a order draft based on it - var basket = await _basketService.GetById(basketId); + var basket = await _basketService.GetByIdAsync(basketId); if (basket == null) { diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs index 1b081bf85..b9fed393f 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs @@ -11,7 +11,7 @@ public class BasketService : IBasketService _logger = logger; } - public async Task GetById(string id) + public async Task GetByIdAsync(string id) { _logger.LogDebug("grpc client created, request = {@id}", id); var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id }); diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs index 008ded21b..143ff9a2b 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs @@ -124,7 +124,7 @@ public class BasketController : ControllerBase //item.PictureUri = // Step 2: Get current basket status - var currentBasket = (await _basket.GetById(data.BasketId)) ?? new BasketData(data.BasketId); + var currentBasket = (await _basket.GetByIdAsync(data.BasketId)) ?? new BasketData(data.BasketId); // Step 3: Search if exist product into basket var product = currentBasket.Items.SingleOrDefault(i => i.ProductId == item.Id); if (product != null) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs index 5897a5c86..448bbec85 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs @@ -20,7 +20,7 @@ public class OrderController : ControllerBase [ProducesResponseType(typeof(OrderData), (int)HttpStatusCode.OK)] public async Task> GetOrderDraftAsync(string basketId) { - if (string.IsNullOrWhitespace(basketId)) + if (string.IsNullOrWhiteSpace(basketId)) { return BadRequest("Need a valid basketid"); } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs index a024560c6..d9b3b0ee1 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/HttpClientAuthorizationDelegatingHandler.cs @@ -15,7 +15,7 @@ public class HttpClientAuthorizationDelegatingHandler var authorizationHeader = _httpContextAccessor.HttpContext .Request.Headers["Authorization"]; - if (!string.IsNullOrWhitespace(authorizationHeader)) + if (!string.IsNullOrWhiteSpace(authorizationHeader)) { request.Headers.Add("Authorization", new List() { authorizationHeader }); } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs index 64feecfa2..41d14d450 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs @@ -10,9 +10,8 @@ public class BasketService : IBasketService _basketClient = basketClient; _logger = logger; } - - - public async Task GetById(string id) + + public async Task GetByIdAsync(string id) { _logger.LogDebug("grpc client created, request = {@id}", id); var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id });