donnytian / Npoi.Mapper

Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supporting resource manager

ptjuanramos opened this issue · comments

Npoi.Mapper currently doesn't support ResourceManager when using the DisplayAttribute.

Consider the follow class:

public class RecordTest {
   [Display(ResourceType = typeof(LabelResource), Name = nameof(LabelResource.Name))]
   public Name { get; set; }

   [Display(ResourceType = typeof(LabelResource), Name = nameof(LabelResource.LastName))]
   public LastName { get; set; }
}

When generating a new file the produced columns names are "Name" and "LastName", which are actually the result of the operations of nameof(LabelResource.Name) and nameof(LabelResource.LastName). This raised up my suspicion that Npoi.Mapper don't support ResourceManager.

Note: I will proceed of implementing this feature if you guys agree.