T4MVC / R4MVC

R4MVC is a Roslyn code generator for ASP.NET Core MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places
Apache License 2.0
157 stars 48 forks source link

Prevent Area and Root controller name clashes #51

Closed artiomchi closed 7 years ago

artiomchi commented 7 years ago

One of the things that should be tackled is preventing the root controllers and area names from clashing.

Say a user has a CatalogsController, and also a Catalogs area with further controllers. The MVC class would have a MVC.Catalogs field for the controller and a MVC.Catalogs property for the area.

I've added a basic check for this, and will rename the area property in the MVC class to MVC.CatalogsArea. All other areas (that don't clash) don't get the suffix.

If someone has a CatalogsAreaController or a CatalogsArea area this will of course cause a clash, but I'm not handling that, since there's no practical reason to have a controller or area named this way :)

Does that sound reasonable?

(a patch to finish this logic will be in the next pull request late this week)

kevinkuszyk commented 7 years ago

Closed via #55.