using Dapper; using NetCore.Model.enums; using NetCore.Model.qw; using System.Collections.Generic; using System.Data; using System.Linq; namespace NetCore.BLL { public class hg_keyword_bll { private string comcode; public hg_keyword_bll(string _comcode) { comcode = _comcode; } /// /// 获取数据 /// /// public List GetList() { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode)) { return con.Query("select keyword from hg_keyword where status=1", null, buffered: false).ToList(); } } /// /// 从配置中获取 /// /// public List GetWordListByParameter() { using (IDbConnection con = ConnectionFactory.CreateConnection(ContextType.qwContext, comcode, false)) { string st = con.Query("select paravalue from bas_parameter where parakey='WeiXin_IllegalKewords'", null, buffered: false).First(); List list = st.Split(';').Where(m => !string.IsNullOrEmpty(m)).Select(m => new hg_keyword() { keyword = m }).ToList(); return list; } } } }