using Chloe; using DB.Entity; namespace DB.Service { public class PointLogService { public void Add(PointLog entityLog) { using (var dbContext = DbFactory.GetContext) { dbContext.Insert(entityLog); } } public PagingResult GetPagedList(int pageIndex, int pageSize, string key) { using (var dbContext = DbFactory.GetContext) { var dao = dbContext.Query() .WhereIf(!string.IsNullOrEmpty(key),x=>x.PointName.Contains(key)) .OrderByDesc(x => x.ID) .Paging(pageIndex, pageSize); return dao; } } } }