Exemple #1
0
 private void When(IDocumentSession session, Events.OrderPlaced created)
 {
     var company = session.Load<CompanySideReadModel>(created.CompanyId);
     session.Store(new ReadModels.Order()
     {
         Id = created.Id,
         CompanyName = company?.Name,
         TotalAmount = created.TotalAmount,
         CompanyId = created.CompanyId
     });             
 }
            private void When(IDocumentSession session, Events.OrderPlaced created)
            {
                Assert.Null(session.Load <ReadModels.Order>(created.Id));
                var company = session.Load <CompanySideReadModel>(created.CompanyId);

                session.Store(new ReadModels.Order()
                {
                    Id            = created.Id,
                    CompanyName   = company?.Name,
                    TotalAmount   = created.TotalAmount,
                    CompanyId     = created.CompanyId,
                    DateProcessed = DateTime.UtcNow
                });
            }