Resharper 6 has a very nice new feature: If I write RedirectToAction or Html.Action anywhere in a MVC3 project, it get's underlined and using ctrl-click I can navigate there. It also notifies me if no such action exists.
However, I have a helper method in my BaseController, which takes an additional parameter (to put into TempData), and then calls a RedirectToAction. Unfortunately, Resharper doesn't acknowledge these strings as controller and method names, and doesn't underline.
I'm using the same parameter naming convention as MVC, my return type is the same, but still no. Is it possible that MVC's methods are hard-coded into Resharper? Is there a way to make it work on my method too?
Yes, you can do it by using ReSharper's code annotation attributes.
First, go to ReSharper->Options->Code Annotations, copy attributes' implementation to clipboard and add them to your project.
Then, mark parameters of your methods with necessary attributes. For example, parameter containing action string, mark with AspMvcActionAttribute
; controller - with AspMvcControllerAttribute
and etc.
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