public static ArchiveCreated ArchiveObjectAsJson(this IArchiveService service, object obj, string name, Action <ArchiveOptions> options = null)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            ArchiveCreated archiveCreated = null;

            using (BeginArchive beginArchive = service.Create(name, (ArchiveCreated x) => archiveCreated = x))
            {
                if (options != null)
                {
                    options(beginArchive.Options);
                }
                beginArchive.IncludeObjectAsJson(obj, name);
            }
            return(archiveCreated);
        }
        public static ArchiveCreated ArchiveObjectAsJson(this IArchiveService service, object obj, string name, Action <ArchiveOptions> options = null)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            ArchiveCreated created = null;

            using (BeginArchive archive = service.Create(name, x => created = x))
            {
                options?.Invoke(archive.Options);

                archive.IncludeObjectAsJson(obj, name);
            }

            return(created);
        }