Hi @Jeff Bowman ,
How to build an ASP.NET Core 6 website that also contains a WebAPI?
If you are using Visual Studio 2022 to create the application, you can use the Asp.net core MVC template to create a MVC application:
Then, right click the Controller folder, and choose Add => Controller option:
In the popup window, you can choose the API controller:
Or, you can right click the Controllers folder, click Add => New Item... => select the API controller.
After running the application, the result like this:
You can also use JavaScript or Httpclient to access the API from the MVC view or controller.
Here are some basic tutorial about MVC and API, you can refer to them:
Create web APIs with ASP.NET Core
Get started with ASP.NET Core MVC
Tutorial: Call an ASP.NET Core web API with JavaScript
Make HTTP requests using IHttpClientFactory in ASP.NET Core.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion