3

I need to find all usages of EditorFor<DateTime> to undo something stupid I did. Is it possible to find all usages of Method<T> for a specific T?

Even hack-y solutions would be appreciated.

Rup
  • 33,765
  • 9
  • 83
  • 112
Josh Kodroff
  • 27,301
  • 27
  • 95
  • 148
  • if you use a version control system you can probably unroll changes that way. I know it's not doing it by resharper or visual studio.. But it does the job! – default Jan 28 '14 at 19:20

2 Answers2

2

If you know the type of the model, you can use Structural Search:

Html.EditorFor($expr$)

Define $expr$ as an expression placeholder and the expression type as:

System.Linq.Expressions.Expression<System.Func<YourModelType, DateTime>>

And you're good to go. Unfortunately I haven't figured out a way to make the search work for less specific types -- the option Exactly this type only seems to cover inheritance, not variance.

Rytmis
  • 31,467
  • 8
  • 60
  • 69
1

You might be able to tell ReSharper to convert calls to EditorFor() to explicitly declare the generic types. Then you could do an old-fashioned text search for "EditorFor"

Nick Strupat
  • 4,928
  • 4
  • 44
  • 56