Designing and securing custom Web APIs
Custom Web APIs can be created using Visual Studio code or Visual Studio 2017. For creating Web APIs, the following programming languages are available:
- ASP.NET
- ASP.NET Core
- Angular
- React.js
Designing your Web API
This demo will be created using .NET Core Framework 2.0 and Visual Studio 2017. Begin by opening up Visual Studio 2017:
- Click on
File
|New
|Project
and, in the newProject
window, selectASP.NET Core Web Application
. Name the project and click onOK
: - A pop-up window opens up where you can select the
Web API
template, selectASP.NET Core 2.0
, and click onOK
:

Creating a custom Web API from Visual Studio 2017
- Add a
Models
folder in theSolution Explorer
. Right-click your project name and selectAdd
|New Folder
. Add aTodoItem
class by right-clicking theModels
folder and clickAdd
|Class
. - Update the
TodoItem
class with the following code:
namespace PacktPubToDoAPI.Models { public class TodoItem { public long Id { get; set; } ...