本文整理汇总了C#中Microsoft.OData.Core.UriParser.ODataQueryOptionParser.ParseCount方法的典型用法代码示例。如果您正苦于以下问题:C# ODataQueryOptionParser.ParseCount方法的具体用法?C# ODataQueryOptionParser.ParseCount怎么用?C# ODataQueryOptionParser.ParseCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Core.UriParser.ODataQueryOptionParser
的用法示例。
在下文中一共展示了ODataQueryOptionParser.ParseCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryOptionWithEmptyValueShouldWork
public void QueryOptionWithEmptyValueShouldWork()
{
var uriParser = new ODataQueryOptionParser(HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet(), new Dictionary<string, string>()
{
{"$filter" , ""},
{"$expand" , ""},
{"$select" , ""},
{"$orderby" , ""},
{"$top" , ""},
{"$skip" , ""},
{"$count" , ""},
{"$search" , ""},
{"$unknow" , ""},
});
uriParser.ParseFilter().Should().BeNull();
var results = uriParser.ParseSelectAndExpand();
results.AllSelected.Should().BeTrue();
results.SelectedItems.Should().HaveCount(0);
uriParser.ParseOrderBy().Should().BeNull();
Action action = () => uriParser.ParseTop();
action.ShouldThrow<ODataException>().WithMessage(Strings.SyntacticTree_InvalidTopQueryOptionValue(""));
action = () => uriParser.ParseSkip();
action.ShouldThrow<ODataException>().WithMessage(Strings.SyntacticTree_InvalidSkipQueryOptionValue(""));
action = () => uriParser.ParseCount();
action.ShouldThrow<ODataException>().WithMessage(Strings.ODataUriParser_InvalidCount(""));
action = () => uriParser.ParseSearch();
action.ShouldThrow<ODataException>().WithMessage(Strings.UriQueryExpressionParser_ExpressionExpected(0, ""));
}
示例2: EmptyQueryOptionDictionaryShouldWork
public void EmptyQueryOptionDictionaryShouldWork()
{
var uriParser = new ODataQueryOptionParser(HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet(), new Dictionary<string, string>());
uriParser.ParseFilter().Should().BeNull();
uriParser.ParseSelectAndExpand().Should().BeNull();
uriParser.ParseOrderBy().Should().BeNull();
uriParser.ParseTop().Should().Be(null);
uriParser.ParseSkip().Should().Be(null);
uriParser.ParseCount().Should().Be(null);
uriParser.ParseSearch().Should().BeNull();
}
示例3: QueryOptionWithNullValueShouldWork
public void QueryOptionWithNullValueShouldWork()
{
var uriParser = new ODataQueryOptionParser(HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet(), new Dictionary<string, string>()
{
{"$filter" , null},
{"$expand" , null},
{"$select" , null},
{"$orderby" , null},
{"$top" , null},
{"$skip" , null},
{"$count" , null},
{"$search" , null},
{"$unknow" , null},
});
uriParser.ParseFilter().Should().BeNull();
uriParser.ParseSelectAndExpand().Should().BeNull();
uriParser.ParseOrderBy().Should().BeNull();
uriParser.ParseTop().Should().Be(null);
uriParser.ParseSkip().Should().Be(null);
uriParser.ParseCount().Should().Be(null);
uriParser.ParseSearch().Should().BeNull();
}