//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 DocumentContentDAL { public long Insert(DocumentContent model) { return Db.mysql.Insert(model).ExecuteIdentity(); } public bool Update(DocumentContent model) { return Db.mysql.Update(model.ID).ExecuteUpdated().Count > 0; } public bool Delete(long id) { return Db.mysql.Delete(id).ExecuteDeleted().Count > 0; } public DocumentContent GetByOne(Expression> where) { return Db.mysql.Select() .Where(where).ToOne(); } public List Query(Expression> where, Expression> orderby = null) { var list = Db.mysql.Select() .Where(where); if (orderby != null) list = list.OrderBy(b => b.CreateDt); return list.ToList(); } } }