Nodes are at the core of CodeStencil's code generation architecture. Without nodes, you don't have the content to use for code generation.  Nodes have many visible and "hidden" features of CodeStencil that make them so powerful. These features are not hidden, they simply function behind the scenes and are not required or necessary to know to use CodeStencil.

Node Labels - This is the text shown on a node and it identifies a node. You can have multiple nodes with the same label within a branch. The only issue with this is that the last node will overwrite any code generated by the first node with the same name.



  1. Models are the node labels of this folder node.
  2. [%DB_CONTEXT%].cs is the node label of this file node
  3. [%CS_TABLE_LIST%] is the node label of this file node.
  4. Index.cshtml {2} is the node label of this file node

Same Name Nodes - Nodes with the same name don't overwrite by the other, the generated contents simply get merged into one file.

Text in braces ( Bracers ) - Whenever CodeStencil encounters text enclosed by braces ("{}") in its node label it excludes that text plus the braces from the label of the file or folder created. It will also check if that text represents a database type, e.g SqlServer, MySql, etc in which case it checks to see if it should bypass that node, in which case it will only generate that node if the text represents the database type of the project.

Database Verification - During code generation, as soon as CodeStencil encounters a node as described in ("Text in braces") above if that node is for a database different from the one specified in the expander - DATABASE, it will automatically disable it, or it will enable it if it matches the current database.


Was this article helpful?