示例#1
0
 public void Register(DocumentBase document)
 {
     if (document != null)
     {
         _identityMap.Add(document);
     }
 }
示例#2
0
        public async Task <Exception> Dispatch(DocumentBase document)
        {
            var repository = GetRepository(document.GetType());

            foreach (var documentMessage in document.Outbox.ToArray())
            {
                try
                {
                    var handler = GetHandler(documentMessage);

                    await handler.Handle(documentMessage, _serviceFactory);

                    document.ProcessDocumentMessage(documentMessage);

                    await repository.Update(document);
                }
                catch (Exception ex)
                {
                    return(ex);
                }
            }
            return(null);
        }
示例#3
0
 public abstract Task Update(DocumentBase document);