SwaggerSource.

ToWebApiController(FilePath, string, Action<CSharpGeneratorSettings>) Method

Summary

Generates a Web API controller class at the given path with the specified settings
Assembly
Cake.NSwag.dll
Namespace
Cake.NSwag.Sources
Containing Type
SwaggerSource

Syntax

public SwaggerSource ToWebApiController(FilePath outputFile, string classPath, Action<CSharpGeneratorSettings> configure = null)

Examples

NSwag
            .FromSwaggerSpecification("./swagger.json")
            .ToWebApiController("./controller.cs", "Generated.Api.ValuesController")

Parameters

Name Type Description
outputFile FilePath File path for the generated client code
classPath string The fully qualified class name (including namespace) for the client
configure Action<CSharpGeneratorSettings> Optional settings to further control the code generation process

Return Value

Type Description
SwaggerSource The metadata source