Ejemplo n.º 1
0
        private List <ExtractedValues> FetchAllPoliticians()
        {
            List <ExtractedValues> politicians = new List <ExtractedValues>();
            bool hasNextLink = true;

            while (hasNextLink)
            {
                OdataClient client = new OdataClient(url);
                Odata       page   = client.fetchData();

                foreach (var politician in page.Value)
                {
                    BiographyReader reader = new BiographyReader(politician.Biografi);
                    reader.ReadBiography();
                    ExtractedValues tempPol = reader.GetPolitician();
                    politicians.Add(tempPol);
                }
                if (page.NextLink == null)
                {
                    hasNextLink = false;
                }
                else
                {
                    url = page.NextLink;
                }
            }
            return(politicians);
        }
 public StudentController(ILogger <StudentController> logger, IStudentService service, OdataClient OdataClient)
 {
     _logger      = logger;
     _Service     = service;
     _OdataClient = OdataClient;
 }
Ejemplo n.º 3
0
 public static void Setup(TestContext context)
 {
     _client = new OdataClient(new Uri("http://localhost:52704/odata"));
 }