Home > Developing Using CodeFluent Entities > Environment Variables Support in CodeFluent Entities

Environment Variables Support in CodeFluent Entities


You can use environment variables in your CodeFluent Entities models by surrounding the environment variable name of ‘%’.

Example:

  • 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.

Carl

  1. No comments yet.
  1. February 21, 2012 at 2:17 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s