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

support return Tuple #709

Open
xieyufei1220 opened this issue May 25, 2023 · 1 comment
Open

support return Tuple #709

xieyufei1220 opened this issue May 25, 2023 · 1 comment
Assignees

Comments

@xieyufei1220
Copy link

I want to pass the specified fields and then return tuple. It's ok with linq to db but error with EF 6. The exception is : Only parameterless constructors and initializers are supported in LINQ to Entities.

code:

async Task Main()
{
	Pick<(string, string)>("x=>new {x.AuthorCode,x.AuthorName}").Dump();  
}

public List<T> Pick<T>(string selector)
{
	return this.Author.Select<T>(selector).ToList();
}

can be improved to support return tuple as linq to db?

@StefH
Copy link
Collaborator

StefH commented May 28, 2023

Related to #491

@StefH StefH self-assigned this May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants