コード例 #1
0
ファイル: Endure.cs プロジェクト: AndyHitchman/Stash
        public void Complete(IStorageWork work, ISerializationSession session)
        {
            storedGraph.SerialisedGraph = registeredGraph.Serialize(UntypedGraph, session);

            var trackedGraph = new TrackedGraph(
                storedGraph,
                CalculateIndexes(),
                registeredGraph);

            work.InsertGraph(trackedGraph);
        }
コード例 #2
0
ファイル: Track.cs プロジェクト: AndyHitchman/Stash
        public virtual void Complete(IStorageWork work, ISerializationSession session)
        {
            storedGraph.SerialisedGraph = registeredGraph.Serialize(UntypedGraph, session);

            CompletionHash = hashCodeGenerator.ComputeHash(storedGraph.SerialisedGraph);

            //Reset stream after calculating hash.
            storedGraph.SerialisedGraph.Position = 0;

            if(CompletionHash.SequenceEqual(OriginalHash))
                //No change to object. No work to do.
                return;

            var trackedGraph = new TrackedGraph(storedGraph, CalculateIndexes(), registeredGraph);
            work.UpdateGraph(trackedGraph);
        }
コード例 #3
0
ファイル: when_completing.cs プロジェクト: AndyHitchman/Stash
 protected override void Given()
 {
     mockRegisteredGraph = MockRepository.GenerateMock<IRegisteredGraph<DummyPersistentObject>>();
     mockStorageWork = MockRepository.GenerateMock<IStorageWork>();
     subject = new Destroy(new InternalId(Guid.NewGuid()), null, mockRegisteredGraph);
 }
コード例 #4
0
ファイル: Destroy.cs プロジェクト: AndyHitchman/Stash
 public void Complete(IStorageWork work, ISerializationSession session)
 {
     work.DeleteGraph(InternalId, registeredGraph);
 }