Sync Fields on Derived Model Objects

Posts   
 
    
mprothme avatar
mprothme
User
Posts: 78
Joined: 05-Oct-2017
# Posted on: 10-Aug-2020 04:41:17   

Build Version: 5.5 (5.5.0) RTM, Build Date: 02-Nov-2018 Project: Adapter project targetting .NET 4.5.2 Database: MS SQL 2016

Currently, if I have an entity that has been reverse-engineered from a given table, the "sync relational model data task" will automatically add any new database columns to said entity. Eg. if I have a customer table and I add a column called notes, that column would automatically be added to the customer entity.

Is there a way to have the designer automatically add new fields to derived elements (DTO Class Models in my case) that were derived from a given entity? or to refresh the derived model using a task? In the above example, the notes column is not added to my customer derived element when I refresh relational data (which means I need to manually edit the model and check the box on the new column).

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Aug-2020 07:21:31   

There is no setting to control whether a new entity field is propagated to derived models. As LLBLGen can't assume you want to add it, the default behavior is that nothing happens you have to add it manually. If this is really important, for the moment you could write a plugin that do exactly that.

David Elizondo | LLBLGen Support Team
mprothme avatar
mprothme
User
Posts: 78
Joined: 05-Oct-2017
# Posted on: 10-Aug-2020 18:18:13   

Our use case is that we leverage derived models to serve as DTO's in our application APIs, and when we add a column on a table we (99% of the time) want that to show up on the DTO.

It doesn't happen often enough to warrant us devoting dev resources to figure out how to write a plugin, but it does happen often enough that it becomes a pain point when we make a schema change, refresh, and then either forget to go find all of the places we reference that entity in our model and add it, or remember, but miss one or two places.

Having a setting on either the model or on the derived element that told LLBLGen Pro to sync fiend changes on entities to their respective elements, or even having a task that you could run (similar to sync relational data) would be a very useful feature.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Aug-2020 08:22:17   

thanks for the feedback! We'll see what we can do to make this easier.

Frans Bouma | Lead developer LLBLGen Pro
mprothme avatar
mprothme
User
Posts: 78
Joined: 05-Oct-2017
# Posted on: 12-Aug-2020 20:26:56   

I appreciate it!