internal override string RenderClientCode(string controllerName, IList <OperationModel> operations)
        {
            var hasClientBaseClass = !string.IsNullOrEmpty(Settings.ControllerBaseClass);

            var template = new WebApiControllerTemplate();

            template.Initialize(new // TODO: Add typed class
            {
                Class     = controllerName,
                BaseClass = Settings.ControllerBaseClass,

                HasBaseClass = hasClientBaseClass,
                BaseUrl      = _service.BaseUrl,

                HasOperations = operations.Any(),
                Operations    = operations
            });

            return(template.Render());
        }
Exemplo n.º 2
0
        internal override string RenderClientCode(string controllerName, IEnumerable <OperationModel> operations)
        {
            var hasClientBaseClass = !string.IsNullOrEmpty(Settings.ControllerBaseClass);

            var template = new WebApiControllerTemplate();

            template.Initialize(new
            {
                Class     = Settings.ClassName.Replace("{controller}", ConversionUtilities.ConvertToUpperCamelCase(controllerName)),
                BaseClass = Settings.ControllerBaseClass,

                HasBaseClass = hasClientBaseClass,
                BaseUrl      = _service.BaseUrl,

                HasOperations = operations.Any(),
                Operations    = operations
            });

            return(template.Render());
        }