Esempio 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));
        }
Esempio 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);
        }