public static async Task TestRepositories(ArchivesSpaceService aspaceService) { Console.WriteLine("All repositories: "); var allRepos = await aspaceService.GetAllRepositoriesAsync(); Console.WriteLine(Serialize(allRepos)); Console.WriteLine("Set repository to BRBL by name"); aspaceService.SetActiveRepository("BRBL"); Console.WriteLine(Serialize(aspaceService.ActiveRepository)); Console.WriteLine("Now set repository to MSSA by ID"); aspaceService.SetActiveRepository(12); Console.WriteLine(Serialize(aspaceService.ActiveRepository)); }
static async Task MainAsync() { //Console.WriteLine("Press 'enter' to begin"); //Console.ReadLine(); var resultsList = new List <Tuple <string, long> >(); var sw = new Stopwatch(); sw.Start(); var aspaceService = new ArchivesSpaceService(); aspaceService.SetActiveRepository("MSSA"); //aspaceService.SetActiveRepository(19); //await TestRepositories(aspaceService); //await TestAccessions(aspaceService); //await TestResources(aspaceService); //await TestResources(aspaceService, 5240); //resultsList.AddRange(await TestArchivalObjects(aspaceService, true, 0)); var targetId = 2087993; //A series-level KSS object resource 5240 //var targetId = 1954935; //Lindbergh MS325 - correspondence 1911-1974 is a large series resource 4817 //var targetId = 1173259; //series-level object from sizer papers MS 453, no id //var targetId = 2312889; //Test archival object for restrictions //var targetId = 2088139; //a bottom level KSS object //var targetId = 1204274; //MS1797 inventory, tiny //var targetId = 2312904; //added by Mark to test container searching resource 5749 repo 19 - has ID //var targetId = 2312903; //added by Mark to test container searching resource 5749 repo 19 - no ID resultsList.AddRange(await TestArchivalObjects(aspaceService, false, targetId)); //resultsList.AddRange(await PrintLocations(aspaceService)); sw.Stop(); foreach (var resultEntry in resultsList) { Console.WriteLine("Task [ {0} ] completed in [ {1} ] ms", resultEntry.Item1, resultEntry.Item2); } Console.WriteLine("Finished, total execution: [ {0} ] ms", sw.ElapsedMilliseconds); Console.ReadLine(); }