/// <summary>
 /// Returns all files in storage
 /// </summary>
 public IEnumerable <TFile> GetAll()
 {
     foreach (LiteFileInfo fileInfo in _fileStorage.FindAll())
     {
         yield return(fileInfo.ToStorageFile <TFile>());
     }
 }
Ejemplo n.º 2
0
        public BsonValue Execute(DbEngine engine, StringScanner s)
        {
            var fs = new LiteFileStorage(engine);

            if (s.HasTerminated)
            {
                var files = fs.FindAll().Select(x => x.AsDocument);

                return(new BsonArray(files));
            }
            else
            {
                var id = this.ReadId(s);

                var files = fs.Find(id).Select(x => x.AsDocument);

                return(new BsonArray(files));
            }
        }
Ejemplo n.º 3
0
        public BsonValue Execute(DbEngine engine, StringScanner s)
        {
            var fs = new LiteFileStorage(engine);

            if (s.HasTerminated)
            {
                var files = fs.FindAll().Select(x => x.AsDocument);

                return new BsonArray(files);
            }
            else
            {
                var id = this.ReadId(s);

                var files = fs.Find(id).Select(x => x.AsDocument);

                return new BsonArray(files);
            }
        }