Environment Variables Support in CodeFluent Entities
You can use environment variables in your CodeFluent Entities models by surrounding the environment variable name of ‘%’.
- Specifying %COMPUTERNAME% in your model will use the COMPUTERNAME environment variable.
The fact that CodeFluent Entities supports environment variables is a key point as it allows us to create portable models.
For instance, CodeFluent Entities knows a key environment variable named “CF_DEFAULT_PERSISTENCE_SERVER”.
This environment variable is used by the default connection string used by producers and if not defined 127.0.0.1 is used.
So if all team members set this “CF_DEFAULT_PERSISTENCE_SERVER” to their proper persistence server, you then don’t have to specify connection strings in your models. Consequently, anyone can build each others model on their environment right-away without having to edit it.
Note: By the way a post was already dedicated to this environment variable: https://blog.codefluententities.com/2011/04/11/default-persistence-server/
To conclude, all connection strings or paths could be in such variables, making your life easier when retrieving a model which was designed by one of your teammate.