private static void Request() { Console.WriteLine("Performing Request ( z39.50 )"); try { // Create the Z39.50 endpoint //var endpoint = new Z3950_Endpoint("vsu", "z3950.lib.vsu.ru", 210, "automat"); var endpoint = new Server("Library of Samara", "z3950.ssu.samara.ru", 210, "books"); //var endpoint = new Z3950Endpoint("Library of Congress", "z3950.loc.gov", 7090, "VOYAGER"); //var endpoint = new Z3950_Endpoint("Canadian National Catalogue", "142.78.200.109", 210, "NL"); var manager = new Z3950Manager(); var str = "sql"; var records = manager.GetRecords(endpoint, Bib1Attr.Title, $"\"{str}\""); Console.WriteLine("Count results: {0}", records.Count); var i = 0; foreach (var marcRecord in records) { marcRecord.SaveMarcToXml("record " + ++i + ".xml"); } } catch (Exception ex) { Console.WriteLine("EXCEPTION. ( " + ex.Message + " )"); } }
public async Task <IDictionary <Server, IEnumerable <MarcRecord> > > Search() { var result = new Dictionary <Server, IEnumerable <MarcRecord> >(); var manager = new Z3950Manager(); foreach (var server in _servers) { var records = await Task.Factory.StartNew(() => manager.GetRecords(server, _bib1Attr, _query)); if (records.Count > 0) { result.Add(server, records); } } return(result); }