TagNameAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供强类型指标的标记信息。
public ref class TagNameAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
public sealed class TagNameAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
type TagNameAttribute = class
inherit Attribute
Public NotInheritable Class TagNameAttribute
Inherits Attribute
- 继承
- 属性
示例
public class MyStrongTypeMetric
{
[TagName("tag_name_as_per_some_convention1")]
public string Name1 { get; set; }
[TagName("tag_name_as_per_some_convention2")]
public string Name2;
}
注解
此属性应用于指标类的字段或属性,以替代默认标记名称。 默认情况下,标记名称与相应的字段或属性相同。 可以使用此属性替代默认值并提供自定义标记名称。