Exemplo n.º 1
0
        public object Parse(string value)
        {
            object parsed = column.Parse(value);

            object[] values = parsed as object[];
            TEntity  result = reader(values);

            return(result);
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 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);
     }
 }