RESTFUL WEB API USING ASP.NET CORE 2.0 WITH MSSQL(using Dapper)

Maheshi Gunarathne
4 min readDec 8, 2017

In here I am going to create a CRUD application by using Dapper for the Data Access Layer, ASP.NET CORE 2.0 for the Rest API layer, and SQL Server for the database. The IDE used was Visual Studio Community 2017.

When creating a WEB API using ASP.NET CORE and Entity Framework CORE, These are the following tools we want ;

  1. Visual Studio 2017
  2. MSSQL server
  3. POSTMAN

STEPS TO CREATE A WEB API WITH CRUD OPERATIONS

  1. First create a database and a table using mssql.

2.Open VS 2017 and create a new project (Empty ASP.NET core web application)

Figure 2. New project Menu VS 2017

Lets choose Web API

Figure 3. Select Web API template.

3. In order to use Entity Framework core we have to install the package

  • open package manager console
  • Install this following package
Install-Package Microsoft.EntityFrameworkCore.SqlServer
  • To enable the reverse engineering to the existing database we have to install the following packages.

--

--

Maheshi Gunarathne

Research Candidate| Software Engineer |Author in Better Programming