If I define a class with a public property that is not used explicitly, but annotate it with either Newtonsoft.Json.JsonProperty
or JetBrains.Annotations.UsedImplicitly
, then I won't get any usage warnings.
Can I define such custom attribute? My motivation is that I already have some custom attributes to mark such properties and adding this feature on top of them would save some redundant annotations.
According to the Resharper Documentation you should be able to apply a MeansImplicitUseAttribute
to your own attribute's definition.
MeansImplicitUseAttribute
Should be used on attributes so that symbols marked with such attributes are not reported as unused. The marked attribute behaves the same as UsedImplicitlyAttribute.