internal override string GenerateClientClass(string controllerName, string controllerClassName, IList <OperationModel> operations, ClientGeneratorOutputType outputType) { UpdateUseDtoClassAndDataConversionCodeProperties(operations); var model = new ClientTemplateModel(GetClassName(controllerClassName), operations, _service, Settings); var template = Settings.CreateTemplate(model); var code = template.Render(); return(AppendExtensionClassIfNecessary(controllerClassName, code)); }
internal override string GenerateClientClass(string controllerName, string controllerClassName, IList <OperationModel> operations, ClientGeneratorOutputType outputType) { var model = new ClientTemplateModel(controllerName, controllerClassName, operations, _service, Settings) { GenerateContracts = outputType == ClientGeneratorOutputType.Full || outputType == ClientGeneratorOutputType.Contracts, GenerateImplementation = outputType == ClientGeneratorOutputType.Full || outputType == ClientGeneratorOutputType.Implementation, }; var template = Settings.CSharpGeneratorSettings.TemplateFactory.CreateTemplate("CSharp", "Client", model); return(template.Render()); }
internal override string GenerateClientClass(string controllerName, string controllerClassName, IList <OperationModel> operations, ClientGeneratorOutputType outputType) { var exceptionSchema = (Resolver as SwaggerToCSharpTypeResolver)?.ExceptionSchema; var model = new ClientTemplateModel(controllerName, controllerClassName, operations, _document, exceptionSchema, Settings) { GenerateContracts = outputType == ClientGeneratorOutputType.Full || outputType == ClientGeneratorOutputType.Contracts, GenerateImplementation = outputType == ClientGeneratorOutputType.Full || outputType == ClientGeneratorOutputType.Implementation, }; var template = Settings.CSharpGeneratorSettings.TemplateFactory.CreateTemplate("CSharp", "Client", model); return(template.Render()); }
public FetchClientTemplate(ClientTemplateModel model) { Model = model; }
public Angular2ClientTemplate(ClientTemplateModel model) { Model = model; }
/// <summary>Initializes the template with a model.</summary> /// <param name="model">The model.</param> public void Initialize(object model) { Model = (ClientTemplateModel)model; }
public JQueryCallbacksClientTemplate(ClientTemplateModel model) { Model = model; }
/// <summary>Renders the client class helper methods.</summary> /// <param name="model">The model.</param> /// <param name="tabCount">The tab count.</param> /// <returns>The helper methods.</returns> public static string RenderClientMethodsCode(ClientTemplateModel model, int tabCount = 0) { var tpl = new ClientMethodsTemplate(model); return(ConversionUtilities.Tab(tpl.Render(), tabCount)); }
public JQueryPromisesClientTemplate(ClientTemplateModel model) { Model = model; }
public ClientMethodsTemplate(ClientTemplateModel model) { Model = model; }