Example #1
0
            public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
            {
                var catalogItem = new CatalogItem(request.CatalogItem.Name);

                _context.CatalogItems.Add(catalogItem);

                await _context.SaveChangesAsync(cancellationToken);

                return(new()
                {
                    CatalogItem = catalogItem.ToDto()
                });
            }