예제 #1
0
        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);
        }
예제 #2
0
 public async Task <bool> RemoveItem(IItemGrain item)
 {
     return(State.Items.Remove(item.GetPrimaryKey()));
 }