I'm confused on wheter you should still use controllers in your Core 2.0 project if you are using razorpages, since they removed the pre-made controllers folder from Core 1.0. Asking as im using Razorpages, Entity framework and sql.
It is up to you. There are people who still use controllers in ASP.NET Core 2 because they do not like the idea of Razor Pages. You can have both of them in the same project. I personally like Razor pages but I still use Controllers when I have to make an ajax call in order to get data from server to update the contents of the page. For ajax calls I also use the razor page by defining handlers to get the data.
Controllers also can be used in a Razor Page project in order to create web services so that other application to be able to retrieve information from the Razor Page application.
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