Update one entity only

If I try to re scaffold only one entity, things break (app no longer builds). I have to re scaffold all entities to get things working again.

Say I added some fields to a database table and/or changed data types, I want to update the model and CRUD page (for example), but only for the entity I updated.

I have to have override existing files checked to update the model/page. It seems to override and/or change some files for the entities that I did NOT select causing the app to break.

Bug or am I missing something?

EDIT: it seems when it saves to the context service file that is where the bug is as that is where all the errors are. Looking at all time stamps, other entities aren't update which is good/what I'd expect.

comparing the contents of the context service file pre and post updating the single entity, it definitely strips out the prior scaffolded entities, so that is a bug imo.

Not sure that I understand what's the problem. Check our forum FAQ for reference on how to improve your post.

--when I click the 'Data' button and then select ALL my entities and then select 'Generate pages for CRUD operations' everything works great.

--looking at the XXXXdatabaseService.cs file in the Services directory everything looks like I would expect with methods etc. for ALL entities.

--Now, I want to update ONE entity ONLY so I click the 'Data' button and uncheck all the entities except the one I want to update, select 'Generate pages for CRUD operations' and finish.

--At this point, build errors occur

--When I go look at the same XXXXdatabaseService.cs file, it only has methods for one entity I updated. I would expect the code for the other entities to still be there, it is not. This is what I feel is a bug.

--The only automatic way to recreate a complete XXXXdatabaseService.cs file is to scaffold ALL entities.

This is not what you should - in this way you've excluded all the unchecked entities and no code will be generated for them

that's my point, this is not the expected outcome.

at some point I'm going to modify my pages beyond what the auto generated files are.

say I modify them and then want to re scaffold a different entity, what I expect is I could go in and only check the entity that I want to update. That functionality seems to be in place, it just doesn't work imo as I've explained.

If you feel there is not I bug, I would then ask what is the point of being allowed to uncheck specific entities?

What I would expect is ONLY the pages in the Model directory that correspond to the selected/checked entities would be modified, not ALL of them. Same for the pages in the Pages directory.

This is how Radzen IDE works since 6 years and this is how we made Radzen Blazor Studio to work. Whatever changes you've made to your database during infer you need to check everything that will be used in the application. On the second step where you can generate CRUD pages you can check only the entities you want to be used for pages creation. Pages are either overwritten with the new code or you can skip that and keep your modifications.

--thank you for discussing this with me.

--I am providing feedback as a new client that I believe there is a bug.

--My last post had some incorrect information as I found out by additional testing BUT there is still one distinct bug in my opinion.

--Everything works as expected EXCEPT that XXXXdatabaseService.cs file. It is regenerated based on ONLY the checked entity when methods related to other entities should remain there. The regeneration should only regenerated methods for the selected entities, not ALL.

--I respectfully request you consult your colleagues to see if they understand my point. Look at it this way, updating one entity should not break the application, it should not cause build errors...


I understand what you'd like to see with the code generation.

What I've been doing, with a variety of tools, is the following workflow:

  1. Generate code.
  2. Customize code.
  3. Check in code.
  4. Regenerate code.
  5. Compare the files; keep the code changes I want from the regeneration. Discard the rest.
  6. Go to Step 2.

While this is not optimal, this is the best workflow I've found so far.

If anyone has a better way to do this, I like to hear it.



That's a good idea, thank you.

I think everything is fine except that one XXXXService.cs file, but I can just undo changes to that one file and should be ok. Guessing maybe you don't have control over the recreation of that services file? All or nothing? Regardless, I'll start doing what you suggest, thank you. Once I get my database dialed in I'll be re scaffolding much less often...

Different topic, maybe should be a different post, but what is the purpose of the 'Overwrite existing files' checkbox? In my testing, if it is unchecked, absolutely nothing happens?? If absolutely nothing happens, should the checkbox even be there? Not overly important, just curious/providing feedback...