jehugaleahsa / FlatFiles

Reads and writes CSV, fixed-length and other flat file formats with a focus on schema definition, configuration and speed.
The Unlicense
357 stars 64 forks source link

Add GetName to ISchema, Schema #49

Closed rgarrison12345 closed 5 years ago

rgarrison12345 commented 5 years ago

While ISchema and Schema have the GetOrdinal function that take in the column name in the schema and returns the ordinal position in that schema that matches that column name. There's no opposite function that takes in the ordinal and returns the column name. I think adding this method will be good where the schema is may not be known to the calling code. Bbut there's a use case where the calling codes need to access a specific column by index to get the column name

jehugaleahsa commented 5 years ago

The alternative is to just get the column using ColumnDefintions and grab the column name via the returned ColumnDefinition. Believe it or not, most ordered collections, like OrderedDictionary don't expose this either. I'm going to leave it alone for now since there's a solution for now.