Creating the Services (Controller)

We will start with an example of coding the service from scratch. For starters, we are going to add a controller class to the project we’ve been working with. The following walks you through this process:

1. Right-click the Controllers folder and choose Add, New Item. From the Add New Item dialog, select Web API Controller Class. Figure 19.5 shows an example. Notice the left side of the dialog that ASP.NET 5 is selected.

Image

FIGURE 19.5 Select Web API Controller Class from the Add New Item dialog.

2. Name the file CustomerController and click the Add button.

Visual Studio will then create a controller class on ...

Get Microsoft Visual Studio 2015 Unleashed, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.