Lambda 动态多条件where查询
public async Task<IEnumerable<RoleControllerActionDto>> Query(int page, int limit, string name, int fatherid)
{
var listAsync = await _db.controller_action.Where(
x => true &&
(string.IsNullOrEmpty(name) || x.chinese_name.Contains(name)) &&
(fatherid == 0 || x.id == fatherid)
).OrderByDescending(x => x.id).Skip((page - 1) * limit).Take(limit).ToListAsync();
var map = Mapper.Map<IEnumerable<RoleControllerActionDto>>(listAsync);
return map;
}