public int GetGlobalSiteOptionAsInt(string name, int defValue) { var val = GlobalSiteOptions.Where(c => c.strName == name).Select(c => c.strValue).FirstOrDefault(); if (val == null) { return(defValue); } int ret; if (!int.TryParse(val, out ret)) { ret = defValue; } return(ret); }
public string GetGlobalSiteOption(string name) { return(GlobalSiteOptions.Where(c => c.strName == name).Select(c => c.strValue).FirstOrDefault()); }