Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 6f8f247

Browse files
Swamy/01jan2021-small-refactoring (#1570)
* Update Startup.cs * Removed commented code * Update UrlsConfig.cs * Small Refactoring * Removed Commented Code * Small Refactoring
1 parent 600d0aa commit 6f8f247

File tree

9 files changed

+7
-39
lines changed

9 files changed

+7
-39
lines changed

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class OrderData
4242

4343
public string Buyer { get; set; }
4444

45-
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
45+
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
4646
}
4747

4848
}

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
55

66
public class UpdateBasketItemsRequest
77
{
8-
8+
99
public string BasketId { get; set; }
1010

1111
public ICollection<UpdateBasketItemData> Updates { get; set; }

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
44
{
5-
5+
66
public class UpdateBasketRequest
77
{
88
public string BuyerId { get; set; }

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task<BasketData> GetById(string id)
2727
{
2828
return await GrpcCallerService.CallService(_urls.GrpcBasket, async channel =>
2929
{
30-
30+
3131
var client = new Basket.BasketClient(channel);
3232
_logger.LogDebug("grpc client created, request = {@id}", id);
3333
var response = await client.GetBasketByIdAsync(new BasketRequest { Id = id });

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task<CatalogItem> GetCatalogItemAsync(int id)
3636
public async Task<IEnumerable<CatalogItem>> GetCatalogItemsAsync(IEnumerable<int> ids)
3737
{
3838

39-
return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel=>
39+
return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel =>
4040
{
4141
var client = new CatalogClient(channel);
4242
var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 };

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ public static async Task<TResponse> CallService<TResponse>(string urlGrpc, Func<
1515

1616
var channel = GrpcChannel.ForAddress(urlGrpc);
1717

18-
/*
19-
using var httpClientHandler = new HttpClientHandler
20-
{
21-
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
22-
};
23-
24-
*/
25-
26-
2718
Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target);
2819

2920
try
@@ -47,13 +38,6 @@ public static async Task CallService(string urlGrpc, Func<GrpcChannel, Task> fun
4738
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
4839
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true);
4940

50-
/*
51-
using var httpClientHandler = new HttpClientHandler
52-
{
53-
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
54-
};
55-
*/
56-
5741
var channel = GrpcChannel.ForAddress(urlGrpc);
5842

5943
Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target);

src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class CatalogOperations
2020
public class BasketOperations
2121
{
2222
public static string GetItemById(string id) => $"/api/v1/basket/{id}";
23-
23+
2424
public static string UpdateBasket() => "/api/v1/basket";
2525
}
2626

src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ public static async Task<TResponse> CallService<TResponse>(string urlGrpc, Func<
1515

1616
var channel = GrpcChannel.ForAddress(urlGrpc);
1717

18-
/*
19-
using var httpClientHandler = new HttpClientHandler
20-
{
21-
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
22-
};
23-
24-
*/
25-
26-
2718
Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target);
2819

2920
try
@@ -49,13 +40,6 @@ public static async Task CallService(string urlGrpc, Func<GrpcChannel, Task> fun
4940
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
5041
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true);
5142

52-
/*
53-
using var httpClientHandler = new HttpClientHandler
54-
{
55-
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
56-
};
57-
*/
58-
5943
var channel = GrpcChannel.ForAddress(urlGrpc);
6044

6145
Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target);

src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF
6363
{
6464
app.UseDeveloperExceptionPage();
6565
}
66-
66+
6767
app.UseHttpsRedirection();
6868

6969
app.UseSwagger().UseSwaggerUI(c =>

0 commit comments

Comments
 (0)