change name of actions in all actionlinks with t4mvc

Jan 17, 2015 at 5:07 AM
hi
I use T4MVC . i expect when i change a action's name all Action Link that referes to thisaction will be change automatically after "Run Custom Tool".
public virtual ActionResult Create()
        {
            return View();
        }
 @Html.ActionLink("Create New Product",result: MVC.Home.Create()) 
i changed "Create" to "Make" in Controller. and clicked on "Run Custom Tool" but "Mvc.Home.Create()" did not change automatically.
Coordinator
Jan 17, 2015 at 7:49 PM
That won't work. Generally, refactoring is not supported in Views, regardless of T4MVC.
Feb 15, 2015 at 12:23 AM
for better refactoring support with views you can use the Views static class T4MVc generates for your controller, refactoring tools like resharper will pick this up for you, not sure about VS refactoring though but it does help avoid convention refactoring 'gotchas'.
public virtual ActionResult Create()
        {
            return View(MVC.Home.Views.ViewNames.Create);
        }
p.s. I typed that code from memory so it might be different, but I swear, it's in there somewhere! :)