public async Task <bool> AddItem(IItemGrain item) { var itemKey = item.GetPrimaryKey(); if (State.Items.TryGetValue(itemKey, out var currentCount)) { State.Items[itemKey] = currentCount + 1; } else { State.Items.Add(itemKey, 1); } return(true); }
public async Task <bool> RemoveItem(IItemGrain item) { return(State.Items.Remove(item.GetPrimaryKey())); }