From 9133fdc043b20be15f958339e96564eac04bed6e Mon Sep 17 00:00:00 2001 From: Megan O'Keefe <3137106+askmeegs@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:36:26 -0800 Subject: [PATCH] EmptyCart bug fix (#289) --- src/cartservice/Program.cs | 6 +++--- src/cartservice/cartstore/LocalCartStore.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cartservice/Program.cs b/src/cartservice/Program.cs index d1f80bb..cf5269b 100644 --- a/src/cartservice/Program.cs +++ b/src/cartservice/Program.cs @@ -56,7 +56,7 @@ namespace cartservice Console.WriteLine($"Trying to start a grpc server at {host}:{port}"); Server server = new Server { - Services = + Services = { // Cart Service Endpoint Hipstershop.CartService.BindService(new CartServiceImpl(cartStore)), @@ -99,7 +99,7 @@ namespace cartservice { case "start": Parser.Default.ParseArguments(args).MapResult( - (ServerOptions options) => + (ServerOptions options) => { Console.WriteLine($"Started as process with id {System.Diagnostics.Process.GetCurrentProcess().Id}"); @@ -127,7 +127,7 @@ namespace cartservice Console.WriteLine($"{CART_SERVICE_PORT} environment variable was not set. Setting the port to 8080"); port = 8080; } - else + else { port = int.Parse(portStr); } diff --git a/src/cartservice/cartstore/LocalCartStore.cs b/src/cartservice/cartstore/LocalCartStore.cs index c1228d5..7fd8a5e 100644 --- a/src/cartservice/cartstore/LocalCartStore.cs +++ b/src/cartservice/cartstore/LocalCartStore.cs @@ -65,7 +65,7 @@ namespace cartservice.cartstore public Task EmptyCartAsync(string userId) { Console.WriteLine($"EmptyCartAsync called with userId={userId}"); - userCartItems[userId] = emptyCart; + userCartItems[userId] = new Hipstershop.Cart(); return Task.CompletedTask; }