Exemplo n.º 1
0
        private static Func <string, object> GetParser <T>(TsvColumnInfo <T> column, Func <TsvColumnInfo <T>, Func <string, object> > parserFactory)
        {
            if (parserFactory != null)
            {
                var result = parserFactory(column);

                if (result != null)
                {
                    return(result);
                }
            }

            return(str => ConvertTo(str, column.MemberInfo.ReturningType(), column.Format));
        }
Exemplo n.º 2
0
        private static Func <object, string> GetToString <T>(TsvColumnInfo <T> column, Func <TsvColumnInfo <T>, Func <object, string> > toStringFactory)
        {
            if (toStringFactory != null)
            {
                var result = toStringFactory(column);

                if (result != null)
                {
                    return(result);
                }
            }

            return(ConvertToString);
        }