using Furion.DependencyInjection; using RoadFlow.Utility; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RoadFlow.Data { public class FlowComment:RoadFlowRepository,IFlowComment, ITransient { /// /// 得到一个用户可以使用的意见 /// /// /// public List GetListByUserId(string userId) { var all = GetAll(); return all.FindAll(p => p.UserId == string.Empty || p.UserId == userId).Distinct(new Model.rf_flowcomment()).OrderBy(p => p.AddType).ToList(); } /// /// 查询一页数据 /// /// /// /// /// /// /// /// public List GetPagerList(out int count, int size, int number, string comment, string userId, string order) { int total = 0; var rtn =db.Queryable() .WhereIF(!comment.IsNullOrWhiteSpace(), x => x.Comments.Contains(comment)) .WhereIF(userId.IsGuid(), x => x.UserId == userId) .OrderByIF(!order.IsNullOrWhiteSpace(), order) .ToPageList(number, size, ref total); count = total; return rtn; } } }