public object Parse(string value) { object parsed = column.Parse(value); object[] values = parsed as object[]; TEntity result = reader(values); return(result); }
private object parse(IColumnDefinition definition, string rawValue) { try { object parsedValue = definition.Parse(rawValue); return(parsedValue); } catch (Exception exception) { throw new ColumnProcessingException(this, definition, rawValue, exception); } }
private static object ParseWithoutContext(IColumnDefinition definition, int position, string rawValue) { try { object parsedValue = definition.Parse(null, rawValue); return(parsedValue); } catch (Exception exception) { throw new ColumnProcessingException(definition, position, rawValue, exception); } }
/// <inheritdoc /> public override object Parse(IColumnContext context, string value) { var sourceValue = columnDefinition.Parse(context, value); if (sourceValue == null) { return(null); } var destinationValue = parser((TSource)sourceValue); return(destinationValue); }
private object Parse(IColumnContext columnContext, IColumnDefinition definition, int position, string rawValue) { try { object parsedValue = definition.Parse(columnContext, rawValue); return(parsedValue); } catch (Exception exception) when(columnContext == null) { throw new ColumnProcessingException(definition, position, rawValue, exception); } catch (Exception exception) { throw new ColumnProcessingException(columnContext, rawValue, exception); } }