FormatAttribute

FormatAttribute class

指示对象序列化对具有指定名称和格式的成员进行序列化

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public sealed class FormatAttribute : Attribute

构造函数

姓名 描述
FormatAttribute(string) 创建具有给定属性 Name 的格式属性
FormatAttribute(string, string) 创建具有给定属性 Name 的格式属性

特性

姓名 描述
PropertyFormat { get; set; } 获取或设置属性的序列化格式。
PropertyName { get; set; } 获取或设置属性的名称。

也可以看看