本文整理汇总了C#中SelectQuery.Should方法的典型用法代码示例。如果您正苦于以下问题:C# SelectQuery.Should方法的具体用法?C# SelectQuery.Should怎么用?C# SelectQuery.Should使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectQuery
的用法示例。
在下文中一共展示了SelectQuery.Should方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldCreateAndWhereQuery
public void ShouldCreateAndWhereQuery()
{
var query =
new SelectQuery<Model.Model>().Select("Id")
.Where("Id", new IsNotNull<int>())
.AndWhere("Id", new IsNull<int>())
.ToString();
query.Should().Be("SELECT [Id] FROM [Model] WHERE ([Id] IS NOT NULL AND [Id] IS NULL)");
}
示例2: ShouldCreateNotEqualsWhereQuery
public void ShouldCreateNotEqualsWhereQuery()
{
var query = new SelectQuery<Model.Model>().Select("Id").Where("Id", new NotEquals<int>(1)).ToString();
query.Should().Be("SELECT [Id] FROM [Model] WHERE [Id] != 1");
}
示例3: ShouldCreateLikeWhereQuery
public void ShouldCreateLikeWhereQuery()
{
var query =
new SelectQuery<Model.Model>().Select(model => model.Name)
.Where(model => model.Name, new Like<string>("%JONY"))
.ToString();
query.Should().Be("SELECT [Name] FROM [Model] WHERE [Name] LIKE '%JONY'");
}
示例4: ShouldCreateLessThenWhereQuery
public void ShouldCreateLessThenWhereQuery()
{
var query = new SelectQuery<Model.Model>().Select("Id").Where("Id", new LessThen<int>(1)).ToString();
query.Should().Be("SELECT [Id] FROM [Model] WHERE [Id] < 1");
}
示例5: ShouldCreateWhereTableNameToQuery
public void ShouldCreateWhereTableNameToQuery()
{
var query = new SelectQuery<Model.Model>().Select("Id").ToString();
query.Should().Contain("SELECT [Id] FROM [Model]");
}