Currently, I'm writing a web application in C# ASP.NET Core and Razor Pages.
In the future I want to replace my frontend with an Angular application. Now I'm wondering how to set up my controllers to serve both technologies.
The problem is, that my controller methods have to return a ViewResult object to properly render the view when using Razor Pages. The result obviously can't be used in Angular and the controller methods aren't really RESTful which I want them to be.
So is there a way to implement a controller supporting Razor and Angular?
Thanks in advance
MediatRto implement CQS or CQSR pattern. Or write special services and call command/query (service method) in controller