public void ToDbType_WithNullableDateTimeOffset() { var actual = DbTypeMapper.ToDbType(typeof(DateTimeOffset?)); //Assert actual.Should().Be(DbType.DateTimeOffset); }
public void ToDbType_WithNullableDecimal() { var actual = DbTypeMapper.ToDbType(typeof(decimal?)); //Assert actual.Should().Be(DbType.Decimal); }
public void ToDbType_WithNullableByte() { var actual = DbTypeMapper.ToDbType(typeof(byte?)); //Assert actual.Should().Be(DbType.Byte); }
public void ToDbType_WithNullableChar() { var actual = DbTypeMapper.ToDbType(typeof(char?)); //Assert actual.Should().Be(DbType.String); }
public void ToDbType_WithMoney() { var actual = DbTypeMapper.ToDbType(typeof(Money)); //Assert actual.Should().Be(DbType.Currency); }
public void ToDbType_WithNullableBoolean() { var actual = DbTypeMapper.ToDbType(typeof(bool?)); //Assert actual.Should().Be(DbType.Boolean); }
public void ToDbType_WithDateTime() { var actual = DbTypeMapper.ToDbType(typeof(DateTime)); //Assert actual.Should().Be(DbType.DateTime); }
public void ToDbType_WithCharArray() { var actual = DbTypeMapper.ToDbType(typeof(char[])); //Assert actual.Should().Be(DbType.String); }
public void ToDbType_WithByteArray() { var actual = DbTypeMapper.ToDbType(typeof(byte[])); //Assert actual.Should().Be(DbType.Binary); }
public void ToDbType_WithNullableDouble() { var actual = DbTypeMapper.ToDbType(typeof(double?)); //Assert actual.Should().Be(DbType.Double); }
public void ToDbType_WithNullableGuid() { var actual = DbTypeMapper.ToDbType(typeof(Guid?)); //Assert actual.Should().Be(DbType.Guid); }
public void ToDbType_WithUnknownType() { var actual = DbTypeMapper.ToDbType(typeof(DbTypeMapperTests)); //Assert actual.Should().Be(DbType.Object); }
public void ToDbType_WithUInt64() { var actual = DbTypeMapper.ToDbType(typeof(ulong)); //Assert actual.Should().Be(DbType.UInt64); }
public void ToDbType_WithXElement() { var actual = DbTypeMapper.ToDbType(typeof(XElement)); //Assert actual.Should().Be(DbType.Xml); }
public void ToDbType_WithUInt16() { var actual = DbTypeMapper.ToDbType(typeof(ushort)); //Assert actual.Should().Be(DbType.UInt16); }
public void ToDbType_WithUInt32() { var actual = DbTypeMapper.ToDbType(typeof(uint)); //Assert actual.Should().Be(DbType.UInt32); }
public void ToDbType_WithString() { var actual = DbTypeMapper.ToDbType(typeof(string)); //Assert actual.Should().Be(DbType.String); }
public void ToDbType_WithTimeSpan() { var actual = DbTypeMapper.ToDbType(typeof(TimeSpan)); //Assert actual.Should().Be(DbType.Time); }
public void ToDbType_WithSingle() { var actual = DbTypeMapper.ToDbType(typeof(float)); //Assert actual.Should().Be(DbType.Single); }
public void ToDbType_WithSByte() { var actual = DbTypeMapper.ToDbType(typeof(sbyte)); //Assert actual.Should().Be(DbType.SByte); }
public void ToDbType_WithNullableInt64() { var actual = DbTypeMapper.ToDbType(typeof(long?)); //Assert actual.Should().Be(DbType.Int64); }
public void ToDbType_WithNullableInt16() { var actual = DbTypeMapper.ToDbType(typeof(short?)); //Assert actual.Should().Be(DbType.Int16); }
/// <summary>Initializes an instance of the <see cref="DataParameter"/> class.</summary> /// <param name="name">The name of the parameter.</param> /// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentException"><paramref name="name"/> is empty.</exception> public DataParameter(string name) : base(name, DbTypeMapper.ToDbType(typeof(T)), ParameterDirection.Input) { }
/// <summary>Initializes an instance of the <see cref="DataParameter"/> class.</summary> /// <param name="name">The name of the parameter.</param> /// <param name="direction">The direction of the parameter.</param> /// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentException"><paramref name="name"/> is empty.</exception> public DataParameter(string name, ParameterDirection direction) : base(name, DbTypeMapper.ToDbType(typeof(T)), direction) { }