예제 #1
0
        public void Handle(IViewContext context, SupplierLocationIsCreated domainEvent)
        {
            SupplierAggregateRoot supplier = context.TryLoad <SupplierAggregateRoot>(domainEvent.SupplierId.ToString());

            if (supplier == null)
            {
                throw new System.Exception($"Can not find Supplier by Id <{domainEvent.SupplierId}>");
            }

            this.SupplierId   = supplier.SupplierId;
            this.SupplierName = supplier.Name;

            this.SupplierLocationId = domainEvent.SupplierLocationId;
            this.LocationName       = domainEvent.Location;
        }