本文整理汇总了C#中FubuMVC.Core.Registration.Querying.ChainSearch.First方法的典型用法代码示例。如果您正苦于以下问题:C# ChainSearch.First方法的具体用法?C# ChainSearch.First怎么用?C# ChainSearch.First使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FubuMVC.Core.Registration.Querying.ChainSearch
的用法示例。
在下文中一共展示了ChainSearch.First方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: find_by_any_looks_at_resource_model_first_then_handler_type_second
public void find_by_any_looks_at_resource_model_first_then_handler_type_second()
{
var candidates = new ChainSearch
{
TypeMode = TypeSearchMode.ResourceModelOnly,
Type = typeof(SimpleOutputModel)
}.FindCandidatesByType(theGraph);
candidates.First().Select(x => x.FirstCall().Description)
.ShouldHaveTheSameElementsAs(
"OneController.Report() : SimpleOutputModel",
"OneController.Query(SimpleInputModel model) : SimpleOutputModel",
"TwoController.Report() : SimpleOutputModel",
"TwoController.NotQuery(SimpleInputModel model) : SimpleOutputModel"
);
}
示例2: find_by_method_if_it_exists
public void find_by_method_if_it_exists()
{
var candidates = new ChainSearch
{
TypeMode = TypeSearchMode.Any,
Type = typeof(SimpleInputModel),
MethodName = "DoSomething"
}.FindCandidatesByType(theGraph);
candidates.First().Any().ShouldBeFalse();
candidates.Last().Single().FirstCall().Description.ShouldEqual("SimpleInputModel.DoSomething(InputModel2 model) : void");
}
示例3: find_by_method_if_it_exists_2
public void find_by_method_if_it_exists_2()
{
var candidates = new ChainSearch
{
TypeMode = TypeSearchMode.Any,
Type = typeof(SimpleInputModel),
MethodName = "Query"
}.FindCandidatesByType(theGraph);
candidates.First().Select(x => x.FirstCall().Description)
.ShouldHaveTheSameElementsAs("OneController.Query(SimpleInputModel model) : SimpleOutputModel");
candidates.Last().Any().ShouldBeFalse();
}
示例4: find_by_any_looks_at_input_model_first_then_handler_type_second
public void find_by_any_looks_at_input_model_first_then_handler_type_second()
{
var candidates = new ChainSearch{
TypeMode = TypeSearchMode.Any,
Type = typeof (SimpleInputModel)
}.FindCandidatesByType(theGraph);
candidates.Count().ShouldEqual(2);
candidates.First().Select(x => x.FirstCall().Description)
.ShouldHaveTheSameElementsAs("OneController.Query(SimpleInputModel model) : SimpleOutputModel", "TwoController.NotQuery(SimpleInputModel model) : SimpleOutputModel");
candidates.Last().Single().FirstCall().Description.ShouldEqual("SimpleInputModel.DoSomething(InputModel2 model) : void");
}