Ejemplo n.º 1
0
 public void Flush(IEnumerable <Profile> profiles)
 {
     if (profiles.Any())
     {
         _serializer.WriteProfileHeader(_writer);
         _serializer.Write(profiles, _writer);
     }
 }
Ejemplo n.º 2
0
 public void Flush(IEnumerable <Profile> profiles)
 {
     if (profiles.Any())
     {
         foreach (var partition in profiles.Partition((a, b) => !_fileNamingStrategy.EqualNames(a, b)))
         {
             var fileName = _fileNamingStrategy.BaseName(partition.First()) + "." + _serializer.FileExtension;
             using (var w = CreateOrOpen(fileName, writer => _serializer.WriteProfileHeader(writer)))
             {
                 _serializer.Write(partition, w);
             }
         }
     }
 }