How to perform a more complex query with AutoQuery

守給你的承諾、 提交于 2019-12-04 22:13:23

AutoQuery will ignore any unmatched fields so you're able to use them to extend your populated AutoQuery with additional custom logic, e.g:

public object Get(LoanQueueQueryGet request)
{
    var q = AutoQuery.CreateQuery(request, Request.GetRequestParams());

    if (request.DateType == DateType.Submitted)
    {
        q.And(x => x.Submitted >= request.StartDate && x.Submitted < request.EndDate);
    }
    else
    {
        q.And(x => x.Funded >= request.StartDate && x.Funded < request.EndDate);
    }

    var loanQueueResponse = AutoQuery.Execute(request, q);
    return loanQueueResponse;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!