3

Given:

  • I have an interface.
  • I have only class that implements that interface.

Question:

With Resharper 4.5 - How can I discard that interface and change all references to the only implementation?

Jim G.
  • 15,141
  • 22
  • 103
  • 166

1 Answers1

1

There doesn't seem to be a way to do this "automagically" in one step.

What I would do in this situation is the following:

  1. "Safe-Delete" (Ctrl-R,D [VS] or Alt-Del [IDEA]) the interface, leaving the code with compilation errors.
  2. Navigating to the next error using (Alt-Shift-PgDn [VS] or Alt-F12 [IDEA]).
  3. Pressing Alt-Enter and selecting "Change all IYourInterfaceName" and typing the concrete class name.

Hope that helps.

Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157