Magicodes.IE
Magicodes.IE copied to clipboard
ExporterHeader 特性写有其他内容,但是不写DisplayName可否回落读取 [DisplayName("")]标签?
l例如这个情况,不写 [ExporterHeader(DisplayName = "备注", IsAutoFit = false)] 导出会显示Remark作为列名.
[ExporterHeader(IsAutoFit = false)]
[JsonProperty, Column(StringLength = -1)]
[DisplayName("备注")]
public string Remark { get; set; }
以下写法是ok的,导出能显示"备注"作为列名
[ExporterHeader(DisplayName = "备注", IsAutoFit = false)]
[JsonProperty, Column(StringLength = -1)]
[DisplayName("备注")]
public string Remark { get; set; }
[JsonProperty, Column(StringLength = -1)]
[DisplayName("备注")]
public string Remark { get; set; }
单元测试不通过!