//using FreeSql.Site.Entity; using FreeSql.Site.Entity; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; namespace FreeSql.Site.DAL { public class DocumentCommentDAL { /// /// 新增方法 /// /// /// public long Insert(DocumentComment model) { return DataBaseType.MySql.DB().Insert(model).ExecuteIdentity(); } /// /// 修改方法 /// /// /// public bool Update(DocumentComment model) { return DataBaseType.MySql.DB().Update(model.ID).ExecuteUpdated().Count > 0; } /// /// 删除方法 /// /// /// public bool Delete(long id) { return DataBaseType.MySql.DB().Delete(id).ExecuteDeleted().Count > 0; } /// /// 获取一条数据 /// /// /// public DocumentComment GetByOne(Expression> where) { return DataBaseType.MySql.DB().Select() .Where(where).ToOne(); } /// /// 查询方法 /// /// /// /// public List Query(Expression> where, Expression> orderby = null) { var list = DataBaseType.MySql.DB().Select() .Where(where); if (orderby != null) list = list.OrderBy(b => b.CreateDt); return list.ToList(); } } }