Mark types explicitly
This commit is contained in:
parent
5f18fe037c
commit
e3f093b53a
|
|
@ -24,8 +24,8 @@ namespace AS1024.CommunityDocumentationPage.Controllers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var results = await _documentation.GetBgpCommunities();
|
RouteTargets results = await _documentation.GetBgpCommunities();
|
||||||
var filtered = results.Results.Where(b => b.Name.StartsWith(_configuration["ASN"]))
|
List<Result> filtered = results.Results.Where(b => b.Name.StartsWith(_configuration["ASN"]))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
return View(filtered);
|
return View(filtered);
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ namespace AS1024.CommunityDocumentationPage.DIScopes
|
||||||
using HttpClient client = new HttpClient();
|
using HttpClient client = new HttpClient();
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", configuration["APIKey"]);
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token", configuration["APIKey"]);
|
||||||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||||
var result = await client.GetAsync(BuildNetBoxURI());
|
HttpResponseMessage result = await client.GetAsync(BuildNetBoxURI());
|
||||||
var stringResult = await result.Content.ReadAsStringAsync();
|
string stringResult = await result.Content.ReadAsStringAsync();
|
||||||
#pragma warning disable CS8603 // Possible null reference return.
|
#pragma warning disable CS8603 // Possible null reference return.
|
||||||
return JsonConvert.DeserializeObject<RouteTargets>(stringResult);
|
return JsonConvert.DeserializeObject<RouteTargets>(stringResult);
|
||||||
#pragma warning restore CS8603 // Possible null reference return.
|
#pragma warning restore CS8603 // Possible null reference return.
|
||||||
|
|
@ -31,7 +31,7 @@ namespace AS1024.CommunityDocumentationPage.DIScopes
|
||||||
|
|
||||||
protected Uri BuildNetBoxURI()
|
protected Uri BuildNetBoxURI()
|
||||||
{
|
{
|
||||||
var endUrl = new UriBuilder
|
UriBuilder endUrl = new UriBuilder
|
||||||
{
|
{
|
||||||
Path = "/api/ipam/route-targets/",
|
Path = "/api/ipam/route-targets/",
|
||||||
Host = configuration["NetBoxHost"],
|
Host = configuration["NetBoxHost"],
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
/// <returns>true if it's a valid bgp community, false if it isn't</returns>
|
/// <returns>true if it's a valid bgp community, false if it isn't</returns>
|
||||||
public static bool IsValidBgpCommunity(this string Community)
|
public static bool IsValidBgpCommunity(this string Community)
|
||||||
{
|
{
|
||||||
var splitStrings =
|
string[] splitStrings =
|
||||||
Community.Split(":", StringSplitOptions.RemoveEmptyEntries);
|
Community.Split(":", StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"iisSettings": {
|
"iisSettings": {
|
||||||
"windowsAuthentication": false,
|
"windowsAuthentication": false,
|
||||||
"anonymousAuthentication": true,
|
"anonymousAuthentication": true,
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"AS1024.CommunityDocumentationPage": {
|
"AS1024.CommunityDocumentationPage": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"applicationUrl": "http://localhost:5224",
|
"applicationUrl": "http://localhost:5224",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
|
|
@ -25,4 +24,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue