Controllers process requests and return views in ASP.NET MVC, but how to add presentation layer (views or html pages) in ASP.NET Core Web API? I need to show to the user not the IEnumerable
collection of objects, but a real webpage. Sorry for the stupid question.
Add MVC packages if not available from nuget package manager
using Microsoft.AspNetCore.Mvc;
add this line to startup.cs
//replace => services.AddControllers();
services.AddControllersWithViews();
I hope you will be able to use MVC feature from now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With