Example #1
0
            public override void GenerateCode(GenerateCodeContext context)
            {
                var model = context.ClientModel;

                context.WriteTemplate("models", context.Templates["Models"], model);
                context.WriteTemplate("helper", context.Templates["Helper"], model);
                context.WriteTemplate("index", context.Templates["index"], model);
                context.WriteTemplate(Helpers.CamelCase(context.Options.ClientName.AsSpan()), context.Templates["ServiceClient"], model);
            }
Example #2
0
            public override void GenerateCode(GenerateCodeContext context)
            {
                var model = context.ClientModel;

                context.WriteTemplate(context.Options.ClientName, context.Templates["ServiceClient"], model);

                foreach (TypeModel type in model.Types)
                {
                    context.WriteTemplate($"Models/{Helpers.PascalCase(type.Name.AsSpan())}", context.Templates["Model"], type);
                }

                foreach (MethodGroupModel group in model.MethodGroups)
                {
                    context.WriteTemplate(group.Name, context.Templates["MethodGroup"], group);
                }
            }