Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议导出时支持枚举 #214

Closed
wensaint opened this issue Dec 17, 2020 · 1 comment
Closed

建议导出时支持枚举 #214

wensaint opened this issue Dec 17, 2020 · 1 comment
Labels

Comments

@wensaint
Copy link

现状:
导入时,同时支持枚举与ValueMapping,代码示例如下:

        [ImporterHeader(Name = "是否已通过")]
        [ValueMapping(text: "是", true)]
        [ValueMapping(text: "否", false)]
        public bool? IsProved { get; set; }
        
        [ExporterHeader(DisplayName = "审核方式")]
        public CheckTypeEnum CheckTypeName { get; set; }

然而在导出时,却只支持ValueMapping,不支持枚举,这种前后不一致性,很容易让人掉坑,希望能统一支持枚举

@hueifeng hueifeng added the area-excel excel label Dec 17, 2020
@hueifeng
Copy link
Member

hueifeng commented Feb 19, 2021

You can add the Description feature to the enumerated values, and I'll continue to fix the Value import problem you mentioned.

public enum MyEnum
{
   [Description("C Test")]
    C
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants