Пример #1
0
        private async Task <ICollection <TopContainer> > GetTopContainersForArchivalObjectAsync(ArchivalObject ao)
        {
            var topContainerManager = new ArchivesSpaceTopContainerManager(ArchivesSpaceService);
            var instances           = await GetAllInstancesForIdActionAsync(ao.Id);

            var topContinerIdList =
                instances.Where(x => x.SubContainer.TopContainer.Ref != null)
                .Select(x => x.SubContainer.TopContainer.RefStrippedId).ToList();

            var topContainerList = await topContainerManager.GetTopContainersByIdsAsync(topContinerIdList);

            return(topContainerList);
        }
Пример #2
0
        private async Task <ICollection <TopContainer> > GetAllTopContainersForResourceActionAsync(Resource resource)
        {
            var resultList          = new List <TopContainer>();
            var topContainerManager = new ArchivesSpaceTopContainerManager(ArchivesSpaceService);

            var initialSearchResult = await topContainerManager.GetTopContainerResourceSearchAsync(resource.Uri, true);

            foreach (var searchResult in initialSearchResult.Results)
            {
                resultList.Add(searchResult.ParsedJson);
            }
            return(resultList);
        }
Пример #3
0
        private async Task <ICollection <TopContainer> > GetTopContainersFromSeriesWithIdentifierAsync(ArchivalObject seriesArchivalObject)
        {
            var resultList          = new List <TopContainer>();
            var topContainerManager = new ArchivesSpaceTopContainerManager(ArchivesSpaceService);

            var initialSearchResult = await topContainerManager.GetTopContainerSeriesSearchAsync(seriesArchivalObject.Uri, true);

            foreach (var searchResult in initialSearchResult.Results)
            {
                resultList.Add(searchResult.ParsedJson);
            }
            return(resultList);
        }