I am working on changing the way DateTime variables are handled in the project (an ASP MVC 5 website,) and I need to find all the usages of variables that are of type DateTime (at least the ones in the views.)  These variables probably all have date or time somewhere in their names, but they are not guaranteed to.  For instance, it could be called anniversary or holiday.
Manually, I would have to find each DateTime in the model, then find usages on each one of those variables.  It's certainly possible, but a lot more error-prone.  Is there any way to find references to variables of a given type (in my case DateTime) in a given project/solution?
EXAMPLE: I have a model object with a DateTime property:
public DateTime Anniversary { get; set; }
Then I render that property in a couple different partial views:
@Html.DisplayFor(m => m.Anniversary)
or
@Html.TextBoxFor(m => m.Anniversary, new { @class = "important date emphasis" })
I would want to find both of the examples in the view because they reference a DateTime variable, even though they are not called DateTime.
Resharper has an advanced search feature that does what you need. See Finding Usages of Related Entities
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