{ //get the value object oValue = GetValue( eKey ); //value not found or null? if (null == oValue) { //return default value return oDefaultValue; } //everything oke: return session value return oValue; } #endregion private: GetMandatoryValue( eKeys eKey )#region private: GetMandatoryValue( eKeys eKey ) /**//// <summary> /// Returns the session value for a session-key that must exist. /// If the key does not exist an applicationException is thrown. /// </summary> /// <param name="eKey"> The session-key to return the session-value for. </param> /// <returns> A none-null value.</returns> private static object GetMandatoryValue( eKeys eKey ) { //get the value object oValue = GetValue( eKey ); //key not found or value null? if ( null == oValue ) { //throw applicationException because its application logic error (none CLR) throw new ApplicationException ( String.Format( sMANDATORY_SESSION_KEY_NOT_FOUND_MSG, eKey.ToString() )); } //everything oke: return value return oValue;