コード例 #1
0
        public void Handle(
            CreateShipment c)
        {
            // example of DomainValidationException
            if (c.Address.StartsWith("1"))
            {
                throw new DomainValidationException($"Can't create shipment with address {c.Address}");
            }

            _shipments.Perform(
                c.Id,
                shipment => shipment.CreateShipment(c.Id, c.Metadata, c.Address), c.Metadata);
        }