예제 #1
0
        public static T Column <T>(this FakeDataReader reader, string name)
        {
            if (reader is null)
            {
                throw new ArgumentException(nameof(reader));
            }

            return(_extractor.Extract <T>(reader.GetValue(reader.GetOrdinal(name))));
        }
        public static TResult Column <T, TResult>(this FakeDataReader reader, string name)
        {
            if (reader is null)
            {
                throw new ArgumentException(nameof(reader));
            }

            T value = _extractor.Extract <T>(reader.GetValue(reader.GetOrdinal(name)));

            return((TResult)ExtractionConverters.DualTypeConverterWithFallback.ConvertToType(value, typeof(TResult)));
        }