MiniExcel
MiniExcel copied to clipboard
Query support enum description mapping

void Main()
{
var value = new[] {
new Dto{Name="Jack",Type=UserType.General},
new Dto{Name="Leo",Type=UserType.Admin},
};
var path = Path.GetTempPath() + Guid.NewGuid() + ".xlsx";
Console.WriteLine(path);
MiniExcel.SaveAs(path,value);
var rows = MiniExcel.Query<Dto>(path);
Console.WriteLine(rows);
}
// You can define other methods, fields, classes and namespaces here
public class Dto
{
public string Name { get; set; }
public UserType Type { get; set; }
}
public enum UserType
{
[Description("General User")]
General,
[Description("Administrator")]
Admin
}