public static string GetRequestTypeName(this ITypeDeclaration type, string name) { if (type == PrimitiveType.Void) { return(""); } else { return($"{type.GetTypeName()} {name}"); } }
public static string GetReturnTypeName(this ITypeDeclaration type) { if (type == PrimitiveType.Void) { return("Task"); } else { return($"Task<{type.GetTypeName()}>"); } }
public static string GetControllerReturnTypeName(this ITypeDeclaration type) { if (type == PrimitiveType.Void) { return("Task"); } else if (type.HasStreams()) { return("async Task<IActionResult>"); } else { return($"Task<{type.GetTypeName()}>"); } }