public Task <Result> ScrapeDepartmentsAsync() => Result.OfAsync(async() => { await(await HtmlClient.GetAsync(Urls.DeptSchedule)).Value.Query <IHtmlSelectElement>("#dept_id").Value .Children <IHtmlOptionElement>().Value.Skip(1) .ForEachAsync(async e => await Departments.AddAsync(new DepartmentModel { Id = Parse.Int(e.Value).Value, Name = e.Label })); });
public Task <Result> ScrapeTermsAsync() => Result.OfAsync(async() => { await Terms.AddRangeAsync((await HtmlClient.GetAsync(Urls.DeptSchedule)).Value .Query <IHtmlSelectElement>("#term_id") .Value .Children <IHtmlOptionElement>().Value.Skip(1) .Select(e => new TermModel { Name = e.Label, Id = Parse.Int(e.Value).Value })); });