MikeStall / DataTable

Class library for working with tabular data, especially CSV files
Apache License 2.0
150 stars 63 forks source link

Fix TypeParse detection for decimal type #28

Closed yellis closed 10 years ago

yellis commented 10 years ago

The TypeParse detection used in Utility.FlattenWorker() threw a System.Reflection.AmbiguousMatchException when being run on a decimal property inside a custom class used in DataTable.New.FromEnumerable(). This was happening because there are two TryParse overloads for this data type.

Modified the logic for this check to allow it to verify that any public and static TryParse function exists for the given type.

Added unit test to verify that this is working for DataTable.New.FromEnumerable() with a class that has a decimal property, related to #17.

yellis commented 10 years ago

I just added logic to confirm that RowAs works with decimal as well