private static void SetRecentSnaphotVersion(IDocumentSession session, IAggregateRoot root)
        {
            var metadata = session.Load <AggregateRootMetadata>(root.Id);

            if (metadata == null)
            {
                metadata = new AggregateRootMetadata
                {
                    Id = MakeRootId(root.Id),
                    RecentSnapshotVersion = root.CurrentVersion
                };
                session.Store(metadata);
            }
            else
            {
                metadata.RecentSnapshotVersion = root.CurrentVersion;
            }
        }
Exemple #2
0
 private static void SetRecentSnaphotVersion(IDocumentSession session, IAggregateRoot root)
 {
    var metadata = session.Load<AggregateRootMetadata>(root.Id);
    if (metadata == null)
    {
       metadata = new AggregateRootMetadata
                     {
                        Id = MakeRootId(root.Id),
                        RecentSnapshotVersion = root.CurrentVersion
                     };            
       session.Store(metadata);
    }
    else
    {
       metadata.RecentSnapshotVersion = root.CurrentVersion;
    }         
 }