Code generation

Is there any plans to make a template for flexible code generation with an end user option to customize these templates?

Hi @Djordje,

I am not sure I understand your request. What is a template for flexible code generation?

Well, maybe this conversation is not appropriate for the forum, but while we're at it.. Each of the components that are created during the initial code generation has some kind of rules that, at least I think, are defined in the form of a script. When we decide to generate a new component, we choose between Empty, CRUD, Data Gid InLine Edit, DataGrid with Form, Master/Detail DataGrid and Master/Detail Hierarchy types and this gives us some kind of flexibility. It would certainly help to increase that flexibility if each user could modify some of the proposed types according to their needs and thus greatly reduce later modifications because they would get much more standard procedures from their own aspect. As these could be scripts located in files accessible for editing, it would certainly expand the base of templates and enable repositories of independently developed templates.That will add more value to this already valuable tool.

Hi @Djordje,

We do use text files when generating code. They are in C:\Program Files\Radzen Blazor Studio\resources\Radzen.Server\Templates\. You can probably try modifying them however I should mention a few things:

  1. We haven't documented the internal API used as it may change in the future.
  2. Some templates are quite complex.
  3. We don't formally support customizations
  4. Installing a new update will most probably overwrite any customizations made.

Providing some official customization support for the generated code is challenging. A single template supports various options which a customization must account for. Not to mention the templates themselves are complex - there is nesting, internal parameters and a a lot of know-how we have gathered over the years and after dealing with thousand of cases.

Yes, I found those files and they are pretty understandable but like you said they are not documented so I did not change anything yet, and of course that your concerns are rightful but was not thinking about changing existing one but make from existing one complete new template with new (or less) functionality that can be enclosed with other template so that new Page (component) could be build upon that new template.In that case all Radzen built templates could stay unchanged and new version will not overwrite changed template. Of course that is not an easy task so it is just an idea to think about.