Help with Search with Pattern: Search for use of member method of a type.
I have the following code:class foo { void bar() { var result = DateTime.Now.ToUniversalTime(); } }
I want to replace all .ToUniversalTime() call with TimeZoneInfo.ConvertTimeToUtcso I start out by try this simple search pattern:
$date$.ToUniversalTime();
where date is type of DateTime or derived types.
This doesn't find anything. What am I not getting with this pattern searching?
Thanks.
Please sign in to leave a comment.
Remove the semicolon in search pattern.

Thanks but unfortunately it didn't help.
It's a pity.
![]()
![]()
![]()
![]()
![]()
Maybe it is a version issue. I have ReSharper 5.1.
Using the pattern before replacing: see attachment UsingPatternBeforeReplacing.jpg
Using the pattern after replacing: see attachment UsingPatternAfterReplacing.jpg
Regards
Markus
Attachment(s):
UsingPatternAfterReplacing.jpg
UsingPatternBeforeReplacing.jpg
Found the issue. I didn't read your screenshots carefully, I had selected "type" instead of "expression" for the $date$ identifier. Thanks!