ASP.NET Core Web API Application structure

We have created a web API project using either Visual Studio IDE on Windows, Yeoman generator, or the .NET Core CLI on Linux/macOS--the application structure will be the same including files, folder, and configuration settings. Let's understand the application structure in detail:

Files and folder

Purpose

The /Controllers folder

This is where we put the Controller classes that handle the requests

The Program.cs file

This is the entry point for application execution using the Main method.

The Startup.cs file

This is needed to set up the configuration and for wiring up the services that the application will use

The .csproj file

This is a C# project file (.csproj), which ...

Get Mastering ASP.NET Web API 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.