This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.webServer> | |
... | |
<httpErrors errorMode="Detailed" existingResponse="PassThrough"> | |
</httpErrors> | |
... | |
</system.webServer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<appSettings> | |
<add key="SearchServiceName" value="<YOUR SEARCH SERVICE NAME HERE>" /> | |
<add key="SearchServiceApiKey" value="<YOUR KEY HERE>" /> | |
<add key="SearchServiceIndexName" value="airports" /> | |
<add key="SearchServiceSuggesterName" value="suggester" /> | |
</appSettings> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0A3,SMITHVILLE,TN,SMITHVILLE MUNI,ATLANTA,SE,http://aeronav.faa.gov/afd/04feb2016/se_386_04FEB2016.pdf | |
0A4,JOHNSON CITY,TN,JOHNSON CITY,CINCINNATI,SE,http://aeronav.faa.gov/afd/04feb2016/se_369_04FEB2016.pdf | |
0A9,ELIZABETHTON,TN,ELIZABETHTON MUNI,CINCINNATI,SE,http://aeronav.faa.gov/afd/04feb2016/se_362_04FEB2016.pdf | |
0M2,TIPTONVILLE,TN,REELFOOT LAKE,ST LOUIS,SE,http://aeronav.faa.gov/afd/04feb2016/se_390_04FEB2016.pdf | |
0M3,HOHENWALD,TN,JOHN A BAKER FLD,ATLANTA,SE,http://aeronav.faa.gov/afd/04feb2016/se_365_04FEB2016.pdf | |
0M4,CAMDEN,TN,BENTON CO,ST LOUIS,SE,http://aeronav.faa.gov/afd/04feb2016/se_355_04FEB2016.pdf | |
0M5,WAVERLY,TN,HUMPHREYS CO,ST LOUIS,SE,http://aeronav.faa.gov/afd/04feb2016/se_392_04FEB2016.pdf | |
1A0,CHATTANOOGA,TN,DALLAS BAY SKY PARK,ATLANTA,SE,http://aeronav.faa.gov/afd/04feb2016/se_356_04FEB2016.pdf | |
1A3,COPPERHILL,TN,MARTIN CAMPBELL FLD,ATLANTA,SE,http://aeronav.faa.gov/afd/04feb2016/se_359_04FEB2016.pdf | |
1A7,GAINESBORO,TN,JACKSON CO,ST LOUIS,SE,http://aeronav.faa.gov/afd/04feb2016/se_363_04FEB201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private AzureSearchEngine azureSearchEngine; | |
private string indexName; | |
private string suggesterName; | |
private System.IO.Stream csvFile; | |
[TestInitialize] | |
public void Initialize() | |
{ | |
indexName = ConfigurationManager.AppSettings["SearchServiceIndexName"]; | |
suggesterName = ConfigurationManager.AppSettings["SearchServiceSuggesterName"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var airportIndexTasks = Parse( async (identifier, city, state, name, chart, region, afdlink) => | |
{ | |
var airport = new Airport() | |
{ | |
Id = Guid.NewGuid().ToString("N"), | |
Identifier = identifier, | |
City = city, | |
State = state, | |
Name = name, | |
Chart = chart, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private delegate Task AirportInfoDelegate(string identifier, string city, string state, string name, string chart, string region, string afdlink); | |
private IEnumerable<Task> Parse(AirportInfoDelegate airportInfoCallback) | |
{ | |
var parser = new Microsoft.VisualBasic.FileIO.TextFieldParser(this.csvFile); | |
parser.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited; | |
parser.SetDelimiters(","); | |
while (!parser.EndOfData) | |
{ | |
//Process row | |
string[] fields = parser.ReadFields(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace AFDSearch.Models | |
{ | |
public class Airport | |
{ | |
public string Id { get; set; } | |
public string Identifier { get; set; } | |
public string City { get; set; } | |
public string State { get; set; } | |
public string Name { get; set; } | |
public string Chart { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using AFDSearch.Models | |
@model AirportSearch | |
@{ | |
ViewBag.Title = "Airport Search"; | |
} | |
@using (Html.BeginForm("Search", "Airport", FormMethod.Post)) | |
{ | |
@Html.TextBoxFor(m => m.SearchText) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>@ViewBag.Title - My ASP.NET Application</title> | |
@Styles.Render("~/Content/css") | |
@Scripts.Render("~/bundles/modernizr") | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using AFDSearch.Models | |
@model AirportSearch | |
@{ | |
ViewBag.Title = "Airport Search"; | |
} | |
@using (Html.BeginForm("Search", "Airport", FormMethod.Post)) | |
{ | |
@Html.TextBoxFor(m => m.SearchText) |
OlderNewer