本文整理汇总了C#中SqlQuery.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# SqlQuery.Equals方法的具体用法?C# SqlQuery.Equals怎么用?C# SqlQuery.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlQuery
的用法示例。
在下文中一共展示了SqlQuery.Equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqualsReturnsFalseIfCommandTextMatchesButArgumentsDiffer
public void EqualsReturnsFalseIfCommandTextMatchesButArgumentsDiffer()
{
var sqlQuery1 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", 10);
var sqlQuery2 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", 35);
Assert.False(sqlQuery1.Equals(sqlQuery2));
}
示例2: EqualsReturnsTrueIfCommandTextMatchesAndSqlArgumentsMatch
public void EqualsReturnsTrueIfCommandTextMatchesAndSqlArgumentsMatch()
{
var sqlQuery1 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", new SqlArgument(10, DbType.Int32));
var sqlQuery2 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", new SqlArgument(10, DbType.Int32));
Assert.True(sqlQuery1.Equals(sqlQuery2));
}
示例3: EqualsReturnsFalseIfCommandTextMatchesButSqlArgumentsDiffer
public void EqualsReturnsFalseIfCommandTextMatchesButSqlArgumentsDiffer()
{
var sqlQuery1 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", new SqlArgument(10, DbType.Int32));
var sqlQuery2 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", new SqlArgument(35, DbType.Int32));
Assert.False(sqlQuery1.Equals(sqlQuery2));
}
示例4: EqualsReturnsFalseIfCommandTextDiffers
public void EqualsReturnsFalseIfCommandTextDiffers()
{
var sqlQuery1 = new SqlQuery("SELECT * FROM Table WHERE Id = @p0", 10);
var sqlQuery2 = new SqlQuery("SELECT * FROM Table WHERE Id <> @p0", 10);
Assert.False(sqlQuery1.Equals(sqlQuery2));
}
示例5: EqualsReturnsFalseIfComparisonObjectNull
public void EqualsReturnsFalseIfComparisonObjectNull()
{
var sqlQuery = new SqlQuery("SELECT");
Assert.False(sqlQuery.Equals((SqlQuery)null));
}
示例6: EqualsReturnsFalseIfComparisonObjectNotSqlQuery
public void EqualsReturnsFalseIfComparisonObjectNotSqlQuery()
{
var sqlQuery = new SqlQuery("SELECT");
Assert.False(sqlQuery.Equals("Foo"));
}