1. Overview
  2. Code Tree
  3. Node Types
  4. Trigger Attribute Updates

Trigger Attribute Updates

This node type will trigger updates to your model classes during the code generation. These updates will modify the classes so that the attributes defined in the Schema Dictionary are applied to the affected properties. Here is a common use case.

In this section of the Code Tree, the "Model" node is where the model classes are imported.

(1) - This copies all the files from the folder the EF Scaffolder generates the classes.

(2) - This removes the DB context class because it is referenced in a separate folder.

(3) - This updates the class(es) that have attributes specified in the Schema dictionary  

Note: In the creation of the nodes, the sequence is important. The files should have been copied before the updates are made.

Now, assuming we have updated the DateOfPayment column in the Payment table to have the following attributes:

After the node - (3) Trigger Attribute Update has been executed, we will see that Payment.cs is now updated with the attributes:

 


Was this article helpful?