Пример #1
0
 public static string GetRequestTypeName(this ITypeDeclaration type, string name)
 {
     if (type == PrimitiveType.Void)
     {
         return("");
     }
     else
     {
         return($"{type.GetTypeName()} {name}");
     }
 }
Пример #2
0
 public static string GetReturnTypeName(this ITypeDeclaration type)
 {
     if (type == PrimitiveType.Void)
     {
         return("Task");
     }
     else
     {
         return($"Task<{type.GetTypeName()}>");
     }
 }
Пример #3
0
 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()}>");
     }
 }