public IDictionary <int, string> GetAllArticleCategories() { logInfo.Info("调用接口【GetAllAricleCategories】查询所有的文章分类"); IDictionary <int, string> articleCategoryDic = null; string strSql = @"SELECT article_category_id,article_category_name FROM article_category"; try { articleCategoryDic = new Dictionary <int, string>(); Database database = new SqliteDatabase(DefaultDBConn.DefaultDbConnectionString); DbCommand command = database.GetSqlStringCommand(strSql); using (IDataReader reader = database.ExecuteReader(command)) { while (reader.Read()) { articleCategoryDic.Add(reader.GetInt32(0), reader.GetString(1)); } } } catch (Exception ex) { logInfo.ErrorFormat("调用接口【GetAllAricleCategories】查询所有的文章分类异常,原因:{0}", ex.Message); } return(articleCategoryDic); }