コード例 #1
0
ファイル: JobOrder.cs プロジェクト: hoangvv1409/codebase
 /// <summary>
 /// Associate an incoming 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 AssociateIncomingInvoice(IEventStore eventStore, Guid invoiceId)
 {
     var count = eventStore.Find<IncomingInvoiceAssociatedToJobOrderEvent>(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 IncomingInvoiceAssociatedToJobOrderEvent(invoiceId, this.Id);
     RaiseEvent(@event);
 }
コード例 #2
0
ファイル: JobOrder.cs プロジェクト: pachinko/naa4e
 public void Apply(IncomingInvoiceAssociatedToJobOrderEvent evt)
 {
     
 }