Example #1
0
        public async Task AddItemWithoutRepetition(Item item)
        {
            await unsafeItemService.AddWithoutRepetition(item);

            item = await safeItemService.GetItemByName(item.Name, false);

            await unsafeWarehouseItemService.Add(new WarehouseItem
            {
                ItemId = item.Id,
                Count  = 0
            });
        }
Example #2
0
        public async Task <Item> GetItemByName(string name, bool ignoreCase)
        {
            var item = cache.Get <Item>($"^item{name}");

            if (item != null)
            {
                return(item);
            }


            item = await safeItemService.GetItemByName(name, ignoreCase);

            cache.AddOrUpdate($"^item{name}", item);
            return(item);
        }
 public async Task <Item> Get(string name)
 {
     return(await safeItemService.GetItemByName(name, true));
 }