public class Home : controller
{
public IActionResult Index()
{
return view();
}
}
I created above class without controller suffix.
And below is my routing in startup.cs class .NET 6:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"
);
});
I just wanted to confirm whether appending “Controller” as a suffix is simply a naming convention, or if there are any potential consequences for not following it. Even though my .NET 6 application seems to function without issue currently.