public void Write(IEnumerable <DocumentMetadata> metadata, string fullName) { var invalid = string.IsNullOrWhiteSpace(fullName); if (invalid) { throw new ArgumentException($"'{fullName}' is not valid"); } _ioService.CreateDirectory(_outputDirectory); var path = GetDerivedPath(fullName); var info = metadata.Select(m => new DocumentMetadataInfo { FullName = m.FullName, ProjectDisplayName = m.ProjectNames.DisplayName, ProjectFullName = m.ProjectNames.FullName }); var json = JsonConvert.SerializeObject(info); using (var writer = _ioService.GetWriter(path)) { writer.WriteLine(json); } }