コード例 #1
0
ファイル: JobOrder.cs プロジェクト: hoangvv1409/codebase
 /// <summary>
 /// Associate an outgoing invoice to the current Job Order
 /// </summary>
 /// <param name="eventStore">The event store</param>
 /// <param name="invoiceId">The Id of the Invoice to be associated to the current Job Order</param>
 /// <exception cref="InvalidOperationException">Thrown if the specified invoiceId refers to an invoice which has already been associated to a Job Order</exception>
 public void AssociateOutgoingInvoice(IEventStore eventStore, Guid invoiceId)
 {
     var count = eventStore.Find<OutgoingInvoiceAssociatedToJobOrderEvent>(e => e.InvoiceId == invoiceId).Count();
     if (count > 0)
     {
         throw new InvalidOperationException("The specified invoice has already been associated to a Job Order.");
     }
     var @event = new OutgoingInvoiceAssociatedToJobOrderEvent(invoiceId, this.Id);
     RaiseEvent(@event);
 }
コード例 #2
0
ファイル: JobOrder.cs プロジェクト: pachinko/naa4e
        public void Apply(OutgoingInvoiceAssociatedToJobOrderEvent evt)
        {

        }