本文整理匯總了C#中NHibernate.SqlCommand.Parameter.Equals方法的典型用法代碼示例。如果您正苦於以下問題:C# Parameter.Equals方法的具體用法?C# Parameter.Equals怎麽用?C# Parameter.Equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NHibernate.SqlCommand.Parameter
的用法示例。
在下文中一共展示了Parameter.Equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: EqualsSameType
public void EqualsSameType()
{
Parameter x = new Parameter( "name", "alias", new SqlTypes.Int32SqlType() );
Parameter y = new Parameter( "name", "alias", new SqlTypes.Int32SqlType() );
Parameter z = new Parameter( "name", "alias", new SqlTypes.Int32SqlType() );
Assert.IsTrue( x.Equals(y) );
Assert.IsTrue( y.Equals(x) );
Assert.IsTrue( y.Equals(z) );
Assert.IsTrue( x.Equals(z) );
Assert.IsFalse( x.Equals(null) );
y = new Parameter( "name2", "alias", new SqlTypes.Int32SqlType() );
Assert.IsFalse( x.Equals(y) );
Assert.IsFalse( y.Equals(x) );
}
示例2: EqualsLengthDiffType
public void EqualsLengthDiffType()
{
Parameter x = new Parameter( "name", "alias", new SqlTypes.AnsiStringSqlType(5) );
ParameterLength y = new ParameterLength( "name", "alias", new SqlTypes.AnsiStringSqlType(5) );
// even though these contain the exact same values - they should not be
// equal because they are different types
Assert.IsFalse( x.Equals(y) );
Assert.IsFalse( y.Equals(x) );
}
示例3: EqualsPrecisionDiffType
public void EqualsPrecisionDiffType()
{
Parameter x = new Parameter( "name", "alias", new SqlTypes.DecimalSqlType( 20, 4 ) );
ParameterPrecisionScale y = new ParameterPrecisionScale( "name", "alias", new SqlTypes.DecimalSqlType( 20, 4 ) );
// even though these contain the exact same values - they should not be
// equal because they are different types
Assert.IsFalse( x.Equals(y) );
Assert.IsFalse( y.Equals(x) );
}