Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where条件动态拼接的问题。 #256

Closed
mylovefly001 opened this issue Mar 30, 2020 · 2 comments
Closed

where条件动态拼接的问题。 #256

mylovefly001 opened this issue Mar 30, 2020 · 2 comments

Comments

@mylovefly001
Copy link

Expression<Func<a, b, bool>> func1 = (a,b) => true;
            if (!string.IsNullOrWhiteSpace(name))
            {
                //?a.name=name
            }
            
            return await DbContext.Mysql.Select<a,b>()
                .LeftJoin((a,b)=>b.Id==a.id)
                .Where(func1)
                .Page(page, pageSize)
                .ToListAsync();

请教一下,如上面的func1怎么拼接。。。
toListAsync里如何同时返回a,b的字段。。。

@2881099
Copy link
Collaborator

2881099 commented Mar 30, 2020

@mylovefly001
Copy link
Author

谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants