Esempio n. 1
0
        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());
        }
Esempio n. 3
0
        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;
 }
Esempio n. 5
0
 public Angular2ClientTemplate(ClientTemplateModel model)
 {
     Model = model;
 }
Esempio n. 6
0
 /// <summary>Initializes the template with a model.</summary>
 /// <param name="model">The model.</param>
 public void Initialize(object model)
 {
     Model = (ClientTemplateModel)model;
 }
Esempio n. 7
0
 public JQueryCallbacksClientTemplate(ClientTemplateModel model)
 {
     Model = model;
 }
Esempio n. 8
0
        /// <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;
 }
Esempio n. 10
0
 public ClientMethodsTemplate(ClientTemplateModel model)
 {
     Model = model;
 }