I’m in the process of developing a web application that utilizes .NET Core for the backend and Angular for the frontend. One of the key questions I have is whether to select ASP.NET Core Web API or ASP.NET Core MVC for the backend.
From what I understand, Angular operates on the MVVM model rather than the MVC structure. This leads me to think that I might not require ASP.NET Core MVC for my application. Nonetheless, I frequently encounter tutorials and materials emphasizing ASP.NET Core MVC for use with Angular.
Could anyone clarify which method is more appropriate for working with Angular and why? Additionally, what are the pivotal distinctions between these two frameworks when incorporating a separate Angular frontend?
// Sample code illustrating my goals
public class ProductController : ControllerBase
{
public async Task<IActionResult> RetrieveProducts()
{
var allProducts = await _productService.GetAllAsync();
return Ok(allProducts);
}
}
I want to ensure I select the correct architectural approach right from the beginning.