11using Fritz . StreamTools . Models ;
2+ using Fritz . StreamTools . Services ;
3+ using LazyCache ;
24using Microsoft . AspNetCore . Mvc ;
5+ using Microsoft . Extensions . Logging ;
36using Microsoft . Extensions . Options ;
7+ using Newtonsoft . Json ;
48using Octokit ;
5- using System . Threading . Tasks ;
6- using System . Linq ;
79using System ;
8- using LazyCache ;
9- using Microsoft . Extensions . Logging ;
10- using Fritz . StreamTools . Services ;
1110using System . Collections . Generic ;
12- using System . Net . Http ;
13- using Newtonsoft . Json ;
1411using System . IO ;
12+ using System . Linq ;
13+ using System . Net . Http ;
14+ using System . Threading . Tasks ;
1515
1616namespace Fritz . StreamTools . Controllers
1717{
@@ -59,11 +59,10 @@ public async Task<IActionResult> ContributorsInformation(string repo, string use
5959 } ) ;
6060 }
6161
62- var newsPosts = await GetNewsFromDiscoverDotNet ( ) ;
62+ // var newsPosts = await GetNewsFromDiscoverDotNet();
6363 var outViewModel = new TickerViewModel ( )
6464 {
65- GitHubInformation = outModel . ToArray ( ) ,
66- News = newsPosts
65+ GitHubInformation = outModel . ToArray ( )
6766 } ;
6867
6968 ViewBag . Configuration = _gitHubConfiguration ;
@@ -75,16 +74,12 @@ public async Task<IActionResult> ContributorsInformation(string repo, string use
7574 private async Task < ( string source , string color , IEnumerable < BlogPostModel > blogPosts ) > GetNewsFromDiscoverDotNet ( )
7675 {
7776 IList < BlogPostModel > posts ;
78- using ( Stream response = await _httpClient . GetStreamAsync ( "https://discoverdot.net/data/news.json" ) )
77+ using ( Stream response = await _httpClient . GetStreamAsync ( "https://discoverdot.net/data/news.json" ) )
7978 {
80- using ( StreamReader reader = new StreamReader ( response ) )
81- {
82- using ( JsonTextReader json = new JsonTextReader ( reader ) )
83- {
84- posts = _serializer . Deserialize < IList < BlogPostModel > > ( json ) ;
85- }
86- }
87- }
79+ using StreamReader reader = new StreamReader ( response ) ;
80+ using JsonTextReader json = new JsonTextReader ( reader ) ;
81+ posts = _serializer . Deserialize < IList < BlogPostModel > > ( json ) ;
82+ }
8883 return ( "Discover .NET" , "#FFCCFF" , posts . Take ( 5 ) . ToArray ( ) ) ;
8984 }
9085
@@ -114,7 +109,8 @@ public async Task<IActionResult> GetContributors()
114109 }
115110
116111
117- public IActionResult Test ( int value , string devName , string projectName ) {
112+ public IActionResult Test ( int value , string devName , string projectName )
113+ {
118114
119115 GitHubService . LastUpdate = DateTime . MinValue ;
120116
@@ -129,8 +125,8 @@ public IActionResult Configuration(GitHubConfiguration configuration)
129125 {
130126 if ( ModelState . IsValid )
131127 {
132- _gitHubConfiguration . RepositoryName = configuration . RepositoryName ;
133- _gitHubConfiguration . RepositoryOwner = configuration . RepositoryOwner ;
128+ _gitHubConfiguration . RepositoryName = configuration . RepositoryName ;
129+ _gitHubConfiguration . RepositoryOwner = configuration . RepositoryOwner ;
134130 }
135131
136132 return View ( configuration ) ;
@@ -177,7 +173,8 @@ public async Task<IActionResult> VerifyRepository(string repositoryName, string
177173 }
178174 }
179175
180- public class TickerViewModel {
176+ public class TickerViewModel
177+ {
181178
182179 public IEnumerable < GitHubInformation > GitHubInformation { get ; set ; }
183180
0 commit comments