public static Func <TextResultSet, T> GetConverter(TextResultSet reader) { if (reader.ColumnCount == 1) { // single... throw new NotImplementedException(); } else { if (cache.TryGetValue(reader.ColumnDefinitions, out var convert)) { return(convert.Value); } else { var key = reader.ColumnDefinitions.Select(x => x.column.ToArray()).ToArray(); var value = cache.AddOrGet(key, x => new Lazy <Func <TextResultSet, T> >(() => (Func <TextResultSet, T>)ConverterCacheHelper.GetFunc(typeof(T)))); return(value.Value); } } }
// TODO:test public MySqlDataReader(TextResultSet resultSet) { this.resultSet = resultSet; }