Exemplo n.º 1
0
        public Task AddItemAsync(IItemConfiguration itemConfiguration)
        {
            if (_itemRepository.Any(x => x.Name == itemConfiguration.Name))
            {
                Log.Warn($"Item with name '{itemConfiguration.Name}' already exists");
                return(Task.CompletedTask);
            }

            var item = _itemBuilder.Build(itemConfiguration);

            return(_itemRepository.AddAsync(item));
        }