I have a model that looks like this:
public class Person { public string PostalCode {get;set;} }
Then I have a razor view
@model MvcApp1.Person Your location is: @Model.PostalCode
When I am using Visual Studio's 2010 rename refactoring (Ctrl+R,R) the property gets renamed on the model class, but stays the same in the view.
My understanding is that since the view is strongly typed, renaming should have also happened in the view.
What am I doing wrong?
Use the Rename refactoring to change names of symbols, files, directories, packages, modules and all the references to them throughout code. Renaming local variables or private methods can be done easily inline since only the limited scope is affected.
Select Edit > Refactor > Rename. Right-click the code and select Rename.
Press F2 and then type the new desired name and press Enter. All usages of the symbol will be renamed, across files.
VS's refactoring engine doesn't support Razor.
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