实现加载md文档内容

This commit is contained in:
hogan
2019-01-10 16:42:20 +08:00
parent 676c0f07a7
commit d9c0ba52fa
15 changed files with 605 additions and 53 deletions

View File

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