ConvertFromDbValue() public method

Converts value at the specified index in the IDataReader into an instance of the specified type.
public ConvertFromDbValue ( IDataReader reader, int index, Type type ) : object
reader IDataReader The IDataReader containing the results.
index int The index of the record to read from the IDataReader.
type System.Type The type to convert result value to.
return object
Ejemplo n.º 1
0
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new UriTypeConverter();

                var exception = Assert.Throws<System.ArgumentNullException>(
                    () => typeConverter.ConvertFromDbValue(null, 0, typeof(System.Uri)));

                Assert.Equal("reader", exception.ParamName);
            }
Ejemplo n.º 2
0
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new UriTypeConverter();

                var exception = Assert.Throws<System.ArgumentNullException>(
                    () => typeConverter.ConvertFromDbValue("foo", null));

                Assert.Equal("type", exception.ParamName);
            }