/// <summary> /// 最新Issueをネットワークから取得する /// </summary> /// <returns>最新Issueリスト</returns> public IssuesEntity GetLatestIssues() { var json = string.Empty; using (var client = new HttpClient()) { var response = client.GetAsync(uri).Result.Content.ReadAsStringAsync(); json = response.Result; } var result = JsonSerializer.Deserialize <List <JsonIssue> >(json); return(IssuesEntity.Create(result.Select(item => item.ToDomainEntity()).ToList())); }
/// <summary> /// IssueデータJsonファイルの読み取り /// </summary> private void loadIssueFile() { var JSONFilePath = Path.Combine(baseDirectory, JSONFileName); // ファイルがない場合は終了 if (!File.Exists(JSONFilePath)) { return; } var json = string.Empty; using (var sr = new StreamReader(JSONFilePath)) { json = sr.ReadToEnd(); } var jsonIssues = JsonSerializer.Deserialize <List <JsonIssue> >(json); issues = IssuesEntity.Create(jsonIssues.Select(item => item.ToDomainEntity()).ToList()); }
public IssuesEntity GetLatestIssues() { var result = JsonSerializer.Deserialize <List <JsonIssue> >(JsonText); return(IssuesEntity.Create(result.Select(item => item.ToDomainEntity()).ToList())); }