- IDE is Visual Studio 2022.
- Port 7182 is open on your machine.
- County Codes used are FIPS (List of counties in Iowa).
- Application only produces accurate results for Story, Greene, or Tama county adjacency.
- You're on a Windows machine.
-
Download and Install SQL Server LocalDB
- Installing SQL Server Express also works for this step (SQL Server Downloads).
-
Start SQL Server LocalDB (using Powershell)
sqllocaldb start "MSSQLLocalDB"
-
Run Script to Create Tables and Entries
- Must be run in the root directory of the project
sqlcmd -S '(localdb)\MSSQLLocalDB' -i "initdb.sql"
-
Install Dependencies, Build Project
- Must be run in the root directory of the project
nuget restore
- Click on Build dropdown in Visual Sudio and select Build Solution
-
Start the API
- You can press the start button in the VS GUI or use Ctrl+F5 to start the API.
- Automatically opens a browser window containing Swagger UI for testing the application
- Expand
/api/checkAdjacency
in the SwaggerUI. - Click on the 'Try it out' button and input Parameters for the county codes you'd like to check the adjacency for.
- Leave Media type as is and click 'Execute'. The output should show up under responses in 'Response body'.
-
Stop SQL Server LocalDB (using Powershell)
sqllocaldb stop "MSSQLLocalDB"
-
Delete SQL Server LocalDB
sqllocaldb delete "MSSQLLocalDB"
-
Stop the Application
- Application can be stopped within the VS Code GUI.
Typically there would be more information in the Swagger doc to describe what the function does, what the county codes are, and possible responses from the API. There were some issues with getting the UI to generate a document including that information. If you are interested, there are comments documenting details of the function more in depth in MainController.cs
within the Controllers directory.