public void LeaseDeleted(IsDeleted isDeleted) { Apply(new LeaseOrderEvents.LeaseDeleted { LeaseId = LeaseOrderId, IsDeleted = isDeleted }); }
protected override void When(object @event) { switch (@event) { case LeaseOrderEvents.CreateLeaseOrder e: Id = new LeaseOrderId(e.LeaseId); DateCreated = new DateCreated(e.DateCreated); IsDeleted = new IsDeleted(e.IsDeleted); IsDelivery = new IsDelivery(e.IsDelivery); IsPaid = new IsPaid(e.IsPaid); BuyerId = new BuyerId(e.CustomerId); TotalPrice = new TotalPrice(e.TotalPrice); Street = new Street(e.Street); ZipCode = new ZipCode(e.ZipCode); City = new City(e.City); break; case LeaseOrderEvents.LeaseAddressUpdated e: Street = new Street(e.Street); ZipCode = new ZipCode(e.ZipCode); City = new City(e.City); break; case LeaseOrderEvents.DateCreatedUpdated e: DateCreated = new DateCreated(e.DateCreated); break; case LeaseOrderEvents.LeaseDeleted e: IsDeleted = new IsDeleted(e.IsDeleted); break; case LeaseOrderEvents.IsDeliveryUpdated e: IsDelivery = new IsDelivery(e.IsDelivery); break; case LeaseOrderEvents.IsPaidUpdated e: IsPaid = new IsPaid(e.IsPaid); break; case LeaseOrderEvents.TotalPriceUpdated e: TotalPrice = new TotalPrice(e.TotalPrice); break; } }