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

Suggested refactoring of type parsing and value reading and writing #211

Open
andywu188 opened this issue Aug 25, 2022 · 1 comment
Open

Comments

@andywu188
Copy link
Contributor

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...

@mganss
Copy link
Owner

mganss commented Aug 26, 2022

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

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

No branches or pull requests

2 participants