Last active
July 14, 2023 10:05
-
-
Save ErgEnn/37bdebc4ab28f586a19eaf1bf35398db to your computer and use it in GitHub Desktop.
[Resharper CodeTemplateAttribute example for renaming] Example of how to use [CodeTemplate] annotation to make renaming easier when you can't directly rename occurances. E.g the renaming happened in Nuget package and needs to be shown to user at later time when they update to version with renamed property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using JetBrains.Annotations; | |
namespace Database | |
{ | |
public class Address | |
{ | |
[CodeTemplate( | |
searchTemplate:"$member$", | |
Message = "Renamed to "+nameof(Longitude), | |
ReplaceTemplate = "$qualifier$."+nameof(Longitude), | |
ReplaceMessage = "Rename to "+nameof(Longitude) | |
)] | |
[Obsolete("Renamed to Longitude", true)] | |
public double? Longtitude { get; set; } | |
public double? Longitude { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment