示例#1
0
        public async Task <string> Index()
        {
            List <FileInfo> files = await _context.GetAllFiles();

            var fileList        = files.ToList();
            var elasticFileInfo = fileList.ConvertAll(f => new ElasticFileInfo
            {
                Id           = f.Id,
                ParentId     = f.ParentId,
                Name         = f.Name,
                Type         = f.Type,
                Description  = f.Description,
                CreatedBy    = f.CreatedBy,
                CreatedOn    = f.CreatedOn,
                LastModified = f.LastModified,
                TypeAsString = ResolveType(f.Type),
                Location     = ResolveLocation(f.Location)
            });

            return($"{_searchEngineService.Index(elasticFileInfo)} files indexed");
        }
示例#2
0
        public async void GetAllFilesByStoredProcedureTest()
        {
            var allFiles = await dbContext.GetAllFiles();

            Assert.Equal(61, allFiles.Count);
        }