Base solution for your next web application

Activities of "mittera"

The file listed in the title is missing the duplication number at the end of the display name value; (See Yellow In Image Below).

I am using 3.3.0

I have attached the entity json files to this link.

I notice the experience when I build Workflow, Workflow Symbol, ProductionOutput, WorkflowProperty, WorkflowSymbolProperty

Then try to rebuild the Workflow one again if you can even get this far before it has the issue.

Not 100% consistent, but it is persistently present.

In power tools templates, there are variables called "{{NP_Foreign_Entity_Name_Here}}" and "{{nP_Foreign_Entity_Name_Here}}".

Is there a plural version of these?

if so what are the variable names for them?

If not, can it be added?

These would be a big help to streamlining my development process.

In the application I am working on I have entity "A", "B", and "C".

"A" is a menu item with "B" as a master detail. "B is also on the menu with "C" as a master detail

If I regenerate in this order C, B, A it all works.

Then I can regenerate "A" without issue multiple times.

Then if I regenerate "B", it still works.

But then If I try to regenerate "A" again it will fail, with the JSON issue listed above.

So not sure it it is the three tired relationship, or just that it was built as both a master and a detail...

But after fixing the JSON I can regenerate "A" again...

Hope this additional information helps.

I can provide them but it requires a couple entity json files to make it happen as it only happens with Master Detail pages.

How do i go about getting you these files? Do I just a attach them here, or is there a better method?

The problem seems to happen randomly, or at least I haven't figured out the trigger yet.

But it usually happens when regenerating an entity that has at least one master detail property.

The build for the primary entity builds then it automatically tries to rebuild the foreign object.

This logs that it is starting in the console, but then just sits there, I have waited 30 minutes, and nothing.

So I cancel the generation, and rerun it, but now the primary entity will not even start...

In review of the json entity files, the primary entity and the foreign entity files have the same timestamp.

This is also the same time of the first failed execution. So both files were updated during the execution.

Nothing looks different in the primary entity file, but the foreign entity file is different with the navigation property looking like the image I sent in creating this ticket.

So I update the navigation property to move the "IsGeneratedbyMasterPage" to where it should be and save the file.

I then can then regenerate the primary entity again, and the foreign entity auto generates as well.

The problem is, Power Tools is reading in valid json using it and then replacing it with invalid json.

The other thing to note, is that once the invalid file is fixed, by simply moving the "IsGeneratedbyMasterPage" property, the fixed file is i identical to the original input file. So Power Tools over wrote it but was not intending to even make any changes..

This makes me wonder is there a way to ensure the entity json files are not auto updated during generation process, especially if the content is not changing.........

When adding a new master detail property to an existing entity, the process fails to generate code.

From looking into the issue it is related to the entity.json data being saved at the beginning of the file generation.

It appears there is a string concatenation issue related to the IsGeneratedByMasterpage property.

Please see attached image:

Thank you that would be great!

Just to pass along an Idea....

What about switching from the optional use of the duplication number on navigation properties and master details to just always using the foreign key property name?

The duplication number is a good idea, but is not working 100%, as multiple places where the duplication number should be appended to ensure multiple navigation or master detail properties are handled successfully via code generation. This is exhibited in the support request above, and I am also seeing the same thing with master detail pages. Also the duplication number is not intuitive or developer friendly as you need to remember what #2 is....

So if you are going to have to fix this long term, why not make it more intuitive and extensible at the same time?

The foreign property name solution simplifies the developer experience, and can be implemented in as many unique configurations as needed. As the foreign property name would be unique for each property added...

What I ended up doing was as follows:

  1. Open the following folder in windows explorer: %SOLUTION_PATH%\AspNetZeroRadTool\FileTemplates\Client\Angular\ModuleTemplate

  2. Copy PartialTemplates.txt to PartialTemplates.custom.txt

  3. Find the following two placeholders and add the condition below them.

3.1) "placeholder": "{{Import_Lookup_Table_Here}}", "condition": "'{{NP_Duplication_Number_Here}}' == ''",

3.2) "placeholder": "{{Declare_Lookup_Table_Here}}", "condition": "'{{NP_Duplication_Number_Here}}' == ''",

Here is an idea to make ASPNetZero template generation much more flexible!

What if an entity, a property, a navigation property, etc.) all had an extra named valued pair collection that could be managed via power tools. This would allow to store custom configuration information specific to an object that could be used in custom templates.

If the UI was added to power tools, the engine could uses its data to auto create replacement / expression variables. This would add tremendous extensibility to the current system, I hope you like it, and implement it!

I found a solution.

The issue was the {{NP_Duplication_Number_Here}} doesn't return '' or 0 as would be expected.

If multiple navigation properties to the same entity are mapped on a new entity, the first one will not return anything if targeting {{NP_Duplication_Number_Here}} in a condition.

All subsequent navigation properties linked to the same entity will return their index (2,3,4,ect...) for {{NP_Duplication_Number_Here}}.

So the trick was to wrap the {{NP_Duplication_Number_Here}} in single quotes like this '{{NP_Duplication_Number_Here}}' this way when it is blank it still returns blank...

My final template condition used for both navigation properties in FileTemplates\Client\Angular\ModuleTemplate\partialtemplates.txt:

"condition": " '{{NP_Duplication_Number_Here}}' == '' "

Now duplicate import and declarations are no longer being produced via generation.

Showing 1 to 10 of 16 entries