Skip to content

IDistributedCache implementation and refactoring for cartservice #838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 28, 2022
Prev Previous commit
Next Next commit
value == null
  • Loading branch information
Mathieu Benoit committed May 25, 2022
commit d76ebb29f03b41677868c3d4be92267ed6c024ac
4 changes: 2 additions & 2 deletions src/cartservice/src/cartstore/RedisCartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task AddItemAsync(string userId, string productId, int quantity)
{
Hipstershop.Cart cart;
var value = await _cache.GetAsync(userId);
if (value.IsNull)
if (value == null)
{
cart = new Hipstershop.Cart();
cart.UserId = userId;
Expand Down Expand Up @@ -89,7 +89,7 @@ public async Task EmptyCartAsync(string userId)
// Access the cart from the cache
var value = await _cache.GetAsync(userId);

if (!value.IsNull)
if (value != null)
{
return Hipstershop.Cart.Parser.ParseFrom(value);
}
Expand Down