public async Task <bool> HandleAsync(CreateItemCategoryCommand command, CancellationToken cancellationToken)
        {
            if (command is null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var model = itemCategoryFactory.Create(new ItemCategoryId(0), command.Name, false);
            await itemCategoryRepository.StoreAsync(model, cancellationToken);

            return(true);
        }
Beispiel #2
0
        public IItemCategory ToDomain(Entities.ItemCategory source)
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(itemCategoryFactory.Create(
                       new ItemCategoryId(source.Id),
                       source.Name,
                       source.Deleted));
        }