Remove namespace or full names

Asked

Viewed 67 times

3

My question is if there is any shortcut, command or Visual Studio function that removes namespace or full class names, for example: for you to add a Data Annotation without doing a using vc you have to put the full namespace System.ComponentModel.Dataannotations.Required(), but after you do a using in the namespace System.ComponentModel.Dataannotations vc only need to put Required().

So what I want is, in a class that was used namespace along with the classes and was not done using, after I do the usings I want to remove the code namespace, to get cleaner.

Only if I go to do it at hand I will have a lot of work and I wanted to know if VS does it quickly and automatically.

  • I answered in the GUJ Replies: http://www.guj.com.br/40502-remover-namespace-ou-fullnames#Answer-50525

1 answer

1


Visualstudio’s re-factoring functionality is very limited, but with Resharper you can do so:

Refactor -> Remove unused References

or simply Cleanup code (Ctrl+E, Ctrl+C)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.