PageRenderTime 51ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/Raven.Database/Bundles/Replication/Plugins/RemoteAttachmentReplicationConflictResolver.cs

https://github.com/barryhagan/ravendb
C# | 28 lines | 20 code | 3 blank | 5 comment | 0 complexity | 1dcd6c535593cd48cbe16ef1013c9d38 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, CC-BY-SA-3.0
  1. // -----------------------------------------------------------------------
  2. // <copyright file="RemoteAttachmentReplicationConflictResolver.cs" company="Hibernating Rhinos LTD">
  3. // Copyright (c) Hibernating Rhinos LTD. All rights reserved.
  4. // </copyright>
  5. // -----------------------------------------------------------------------
  6. using System;
  7. using System.ComponentModel.Composition;
  8. using Raven.Abstractions.Data;
  9. using Raven.Bundles.Replication.Plugins;
  10. using Raven.Json.Linq;
  11. namespace Raven.Database.Bundles.Replication.Plugins
  12. {
  13. [PartNotDiscoverable]
  14. public class RemoteAttachmentReplicationConflictResolver : AbstractAttachmentReplicationConflictResolver
  15. {
  16. public static RemoteAttachmentReplicationConflictResolver Instance = new RemoteAttachmentReplicationConflictResolver();
  17. public override bool TryResolve(string id, RavenJObject metadata, byte[] data, Attachment existingAttachment, Func<string, Attachment> getAttachment,
  18. out RavenJObject metadataToSave, out byte[] dataToSave)
  19. {
  20. metadataToSave = metadata;
  21. dataToSave = data;
  22. return true;
  23. }
  24. }
  25. }