本文整理汇总了C#中ICall.GetReturnType方法的典型用法代码示例。如果您正苦于以下问题:C# ICall.GetReturnType方法的具体用法?C# ICall.GetReturnType怎么用?C# ICall.GetReturnType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICall
的用法示例。
在下文中一共展示了ICall.GetReturnType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public RouteAction Handle(ICall call)
{
var type = call.GetReturnType();
var compatibleProviders = _autoValueProviders.Where(x => x.CanProvideValueFor(type)).FirstOrNothing();
return compatibleProviders.Fold(
RouteAction.Continue,
ReturnValueUsingProvider(call, type));
}
示例2: Handle
public RouteAction Handle(ICall call)
{
var type = call.GetReturnType();
var compatibleProviders = _autoValueProviders.Where(x => x.CanProvideValueFor(type));
if (compatibleProviders.Any())
{
var valueToReturn = compatibleProviders.First().GetValue(type);
ConfigureCall.SetResultForCall(call, new ReturnValue(valueToReturn), MatchArgs.AsSpecifiedInCall);
return RouteAction.Return(valueToReturn);
}
return RouteAction.Continue();
}
示例3: IsResultFor
public bool IsResultFor(ICall call)
{
return call.GetReturnType() == _type;
}
示例4: ReturnsVoid
private bool ReturnsVoid(ICall call)
{
return call.GetReturnType() == typeof(void);
}
示例5: ReturnsVoidFrom
bool ReturnsVoidFrom(ICall call)
{
return call.GetReturnType() == typeof (void);
}