Link to home
Start Free TrialLog in
Avatar of PSCTECH
PSCTECH

asked on

C# rename a class and update all references efficiently

Is there a way to change the name of a class in the model and simultaneously update all of the references.
I know I can do a "find all references" and update them one by one manually, but there must be a better way.
There are other model classes that use properties of the one to be renamed, one that inherits from it and multiple UI pages that reference the properties in this class.
I just want to do this as completely and efficiently as possible.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PSCTECH
PSCTECH

ASKER

Thank you.  That's exactly what I needed.
Also, if you simply edit the object name, you will notice that the background changes:

User generated image
If you simply tap Ctrl-period, then you'll get a quick-action menu that allows you update all references:

User generated image
Hi PSCTECH;

Using the Re-name dialog box will allow you to rename the class name in all references in all files as can be seen from the last line of text in the dialog box in my initial post.
So does my suggestion  ; )

Though I don't think it takes care of strings, so that could be an argument against it. Well...it should handle XML comments.
Avatar of PSCTECH

ASKER

Great help.  Thank you!