本文整理汇总了C#中IMethod.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# IMethod.ThrowIfNull方法的具体用法?C# IMethod.ThrowIfNull怎么用?C# IMethod.ThrowIfNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethod
的用法示例。
在下文中一共展示了IMethod.ThrowIfNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetReturnType
public CodeTypeReference GetReturnType(IMethod method)
{
method.ThrowIfNull("method");
return GeneratorUtils.GetSchemaReference(schemaNamespace, method.ResponseType);
}
示例2: AssignParameterToDictionary
protected CodeAssignStatement AssignParameterToDictionary(IParameter param, int parameterCount, IMethod method)
{
method.ThrowIfNull("method");
var assign = new CodeAssignStatement();
assign.Left = new CodeArrayIndexerExpression(
new CodeVariableReferenceExpression(ParameterDictionaryName), new CodePrimitiveExpression(param.Name));
assign.Right =
new CodeVariableReferenceExpression(
GeneratorUtils.GetParameterName(param, method.Parameters.Keys.Without(param.Name)));
return assign;
}
示例3: AddIsMethodResult
internal static void AddIsMethodResult(IDictionary<JsonSchema, SchemaImplementationDetails> details,
IService service,
IMethod method)
{
details.ThrowIfNull("details");
service.ThrowIfNull("service");
method.ThrowIfNull("method");
string id = method.ResponseType;
if (string.IsNullOrEmpty(id))
{
// Return if this method has no response type
return;
}
// Check if this name is a valid schema
if (!service.Schemas.ContainsKey(id))
{
return;
}
ISchema schema = service.Schemas[id];
// If no implementation details have been added yet, create a new entry
SchemaImplementationDetails implementationDetails = GetOrCreateDetails(details, schema.SchemaDetails);
// Change the value
implementationDetails.IsMethodResult = true;
}