I’m studying Getting Started with ASP.NET MVC3 chapter from asp.net. I’ve just created the MoviesController controller but I made a typo. How to rename it (so it doesn’t break anything). Unfortunately, I didn’t find in the Solution Explorer how to rename (refactor) the controller so all name changes apply through the whole project. As least, the controller .cs file , Views folder and probably some names in the files should be renamed. What is the proper way to do that?
I’m studying Getting Started with ASP.NET MVC3 chapter from asp.net . I’ve just created
Share
I feel ReSharper is a tool that can’t be missing in your Visual Studio configuration. It’s a productivity add-on that allows you to very easily refactor your code, clean it up, find issues, and find files or classes.
For example, for your use case, you simply place your caret on the controller name and use the refactor shortcut hotkey to rename it, and it will rename all usages of the class, and in the case of controllers it will do so in views as well.
Very handy. to me it’s a requirement. I’ve been using it for three years now, never looked back.