This application consists of:
- Simple database with one Todo table.
- Simple Controller that implements CRUD operations on Todo table.
Setup and configure
- Create new database on SQL Server 2016 or Azure SQL.
- If you are using Azure SQL make sure that firewall rules in Azure enable you to make connections between your host and Azure SQL database.
- Execute setup.sql script to create Todo table and populate it with sample data.
- Open .xproj file in Visual Studio 2015 and set connection string in Startup.cs file:
public void ConfigureServices(IServiceCollection services)
{
const string ConnString = "Server=SERVERNAME.database.windows.net;Database=DATABASENAME;User Id=USERNAME;Password=PASSWORD";
Run
- Run the project and see results returned from /api/Todo URL.
- Open /api/Todo/1 URL to try GET method that returns single Todo item.
- Use some tool that send POST, PUT, PATCH, or DELETE requests to web server (e.g. Chrome Poster) to try other methods.