We have a business need to deserialize a csv file row by row, to a defined class, using the row headers in the csv as the mapping. We had a few questions about if we can use FromCSV in ServiceStack.Text to serve our needs:
- If a field value cannot be serialized to the correct type (e.g. they submit 42 in a DateTime field) we need to be able to let them know the specific field which caused the error. I couldn’t find any documentation on exception/error handling during the deserialization. Is this possible?
- Some of the types in the class are Enums - will the deserializer fail if the value provided doesn’t fall within the enum values?
If FromCSV doesn’t support these things, then is there a way to accomplish them with the ServcieStack.Text libraries or am I better off using something like FileHelpers?
thanks!