表达式目录树插件xLiAd.SqlEx.Core

表达式目录树使用时 引用xLiAd.SqlEx.Core ,是一个很好的插件

using xLiAd.SqlEx.Core.Helper;

Expression<Func<ReportedData, bool>> expression = p => p.CompanyId == companyId;
if (models.StartDate != null)
{
expression = expression.And(p => p.createTime > Convert.ToDateTime(models.StartDate));
}
if (models.EndDate != null)
{
expression = expression.And(p => p.createTime < Convert.ToDateTime(models.EndDate));
}

posted @ 2020-01-15 15:22  清枫林  阅读(154)  评论(0编辑  收藏  举报