From e3f093b53ad5fef757c9e77cb0a9f4bf8b581357 Mon Sep 17 00:00:00 2001 From: Jeff Leung Date: Sun, 8 Jan 2023 15:35:19 -0800 Subject: [PATCH] Mark types explicitly --- .../Controllers/HomeController.cs | 4 ++-- .../DIScopes/NetboxBgpCommunityDocumentation.cs | 6 +++--- .../DIScopes/ValidateBgpCommunity.cs | 2 +- .../Properties/launchSettings.json | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/AS1024.CommunityDocumentationPage/Controllers/HomeController.cs b/AS1024.CommunityDocumentationPage/Controllers/HomeController.cs index ed59390..44f6a98 100644 --- a/AS1024.CommunityDocumentationPage/Controllers/HomeController.cs +++ b/AS1024.CommunityDocumentationPage/Controllers/HomeController.cs @@ -24,8 +24,8 @@ namespace AS1024.CommunityDocumentationPage.Controllers { try { - var results = await _documentation.GetBgpCommunities(); - var filtered = results.Results.Where(b => b.Name.StartsWith(_configuration["ASN"])) + RouteTargets results = await _documentation.GetBgpCommunities(); + List filtered = results.Results.Where(b => b.Name.StartsWith(_configuration["ASN"])) .ToList(); return View(filtered); diff --git a/AS1024.CommunityDocumentationPage/DIScopes/NetboxBgpCommunityDocumentation.cs b/AS1024.CommunityDocumentationPage/DIScopes/NetboxBgpCommunityDocumentation.cs index 6d3b151..93a2d7c 100644 --- a/AS1024.CommunityDocumentationPage/DIScopes/NetboxBgpCommunityDocumentation.cs +++ b/AS1024.CommunityDocumentationPage/DIScopes/NetboxBgpCommunityDocumentation.cs @@ -22,8 +22,8 @@ namespace AS1024.CommunityDocumentationPage.DIScopes using HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", configuration["APIKey"]); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - var result = await client.GetAsync(BuildNetBoxURI()); - var stringResult = await result.Content.ReadAsStringAsync(); + HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI()); + string stringResult = await result.Content.ReadAsStringAsync(); #pragma warning disable CS8603 // Possible null reference return. return JsonConvert.DeserializeObject(stringResult); #pragma warning restore CS8603 // Possible null reference return. @@ -31,7 +31,7 @@ namespace AS1024.CommunityDocumentationPage.DIScopes protected Uri BuildNetBoxURI() { - var endUrl = new UriBuilder + UriBuilder endUrl = new UriBuilder { Path = "/api/ipam/route-targets/", Host = configuration["NetBoxHost"], diff --git a/AS1024.CommunityDocumentationPage/DIScopes/ValidateBgpCommunity.cs b/AS1024.CommunityDocumentationPage/DIScopes/ValidateBgpCommunity.cs index c74d670..5db2c09 100644 --- a/AS1024.CommunityDocumentationPage/DIScopes/ValidateBgpCommunity.cs +++ b/AS1024.CommunityDocumentationPage/DIScopes/ValidateBgpCommunity.cs @@ -9,7 +9,7 @@ /// true if it's a valid bgp community, false if it isn't public static bool IsValidBgpCommunity(this string Community) { - var splitStrings = + string[] splitStrings = Community.Split(":", StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < 1; i++) diff --git a/AS1024.CommunityDocumentationPage/Properties/launchSettings.json b/AS1024.CommunityDocumentationPage/Properties/launchSettings.json index 79168a3..e6a8e3f 100644 --- a/AS1024.CommunityDocumentationPage/Properties/launchSettings.json +++ b/AS1024.CommunityDocumentationPage/Properties/launchSettings.json @@ -1,4 +1,4 @@ -{ +{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, @@ -10,7 +10,6 @@ "profiles": { "AS1024.CommunityDocumentationPage": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "applicationUrl": "http://localhost:5224", "environmentVariables": { @@ -25,4 +24,4 @@ } } } -} +} \ No newline at end of file