ExcelMapper icon indicating copy to clipboard operation
ExcelMapper copied to clipboard

Suggested refactoring of type parsing and value reading and writing

Open andywu188 opened this issue 3 years ago • 1 comments

At present, the type and dynamic type parsing code in the project is confusing. It is recommended to refer to Json.net to refactor ColumnInfo, ExcelMapper and ITypeMapperFactory.

IValueProvider https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Serialization/IValueProvider.cs

IContractResolver https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/Serialization/IContractResolver.cs

JsonContract JsonContractType https://github.com/JamesNK/Newtonsoft.Json/blob/cb9eed96665019f7398c53c540a87ce675f5d938/Src/Newtonsoft.Json/Serialization/JsonContract.cs

JsonConverter https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/JsonConverter.cs

JsonSerializerSettings https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/JsonSerializerSettings.cs

Type parsing improvements support a variety of types, the following types can theoretically be exported to excel.

Entity Type (important) dynamic(ExpandoObject) (important) DataTable (important) DataSet (important) Array Dictionary Hashtable XmlDocument Other...

Improved value parsing, which can be extended and registered by itself, stripping out Json parsing. base value type: byte sbyte short ushort int uint long ulong float double decimal DateTime

other type: char string TimeSpan byte[] Guid Object(Json) Other...

andywu188 avatar Aug 25 '22 08:08 andywu188

How would you map complex types like DataTable, Dictionary etc. to Excel?

mganss avatar Aug 26 '22 10:08 mganss