Example #1
0
        public IEnumerable <IEntry> GetEntries(string path)
        {
            var frags = mapper.GetPathFragmentsFromTargetPath(path);

            foreach (var frag in frags)
            {
                var e = FindEntry(frag);
                ;
                if (e.IsLazy)
                {
                    var layer = layers[e.LayerId];
                    var es    = layer.GetEntries(frag);
                    collection.Upsert(EntryDataDto.Convert(es));
                }
            }

            var result = collection.Find(dto => dto.ParentDirectory == path)
                         .GroupBy(dto => dto.Path)
                         .Select(g => g.OrderBy(dto => dto.Priority).FirstOrDefault())
                         .Where(dto => dto != null)
                         .Select(dto => layers[dto.LayerId].GetEntry(dto.Path))
                         .ToArray()
            ;

            return(result);
        }
Example #2
0
 public async ValueTask PreLoad()
 {
     foreach (var layer in layers.Values)
     {
         var entries = EntryDataDto.Convert(layer.GetPreloadEntries());
         collection.Upsert(entries);
     }
 }
Example #3
0
        public IEntry GetEntry(string fileName)
        {
            var frags = mapper.GetPathFragmentsFromTargetPath(fileName);

            foreach (var frag in frags.SkipLast(1))
            {
                var e = FindEntry(frag);
                ;
                if (e?.IsLazy == true)
                {
                    var layer = layers[e.LayerId];
                    var es    = layer.GetEntries(frag);
                    collection.Upsert(EntryDataDto.Convert(es));
                }
            }

            var result = collection.Find(dto => dto.Path == fileName)
                         .OrderBy(dto => dto.Priority)
                         .Select(dto => layers[dto.LayerId].GetEntry(dto.Path))
                         .FirstOrDefault()
            ;

            return(result);
        }