Ejemplo n.º 1
0
        public static Journal Open(IJournalReaderWriterFactory readerWriterFactory, IMarkdownFiles markdownFiles, ISystemProcess systemProcess)
        {
            if (!MemoryCache.Default.Contains(nameof(FirstEntryDate)))
            {
                var firstEntryDate = markdownFiles
                                     .FindAll(fileNamesOnly: true)
                                     .Select(md => FileNameWithExtensionPattern.Parse(md))
                                     .Select(x => x.Value)
                                     .OrderBy(dt => dt)
                                     .First();

                MemoryCache.Default.Set(nameof(FirstEntryDate), firstEntryDate, Policy);
            }

            return(new Journal(readerWriterFactory, markdownFiles, systemProcess));
        }
Ejemplo n.º 2
0
 private Journal(IJournalReaderWriterFactory readerWriterFactory, IMarkdownFiles markdownFiles, ISystemProcess systemProcess)
 {
     _readerWriterFactory = readerWriterFactory;
     _markdownFiles       = markdownFiles;
     _systemProcess       = systemProcess;
 }
Ejemplo n.º 3
0
 public static Journal Open(IJournalReaderWriterFactory readerWriterFactory, IMarkdownFiles markdownFiles, ISystemProcess systemProcess)
 {
     return(new Journal(readerWriterFactory, markdownFiles, systemProcess));
 }