/// <param name="entityManager"> entoty manager for db query </param> /// <returns> Integer value representing the history level or <code>null</code> if none found </returns> public static int?DatabaseHistoryLevel(CommandContext entityManager) { try { //PropertyEntity historyLevelProperty = entityManager.SelectById<PropertyEntity>(typeof (PropertyEntity), //"historyLevel"); PropertyEntity historyLevelProperty = entityManager.PropertyManager.Get("historyLevel"); return(historyLevelProperty != null?Convert.ToInt32(historyLevelProperty.Value) : (int?)null); } catch (System.Exception e) { Log.CouldNotSelectHistoryLevel(e.Message); return(null); } return(0); }