Skip to content
New issue

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

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

Already on GitHub? # to your account

Added support for querying large value tuples #73

Merged
merged 1 commit into from
Aug 22, 2020
Merged

Conversation

esentio
Copy link
Owner

@esentio esentio commented Aug 22, 2020

It is now possible to return value tuples with 8 and more elements (where TRest is another value tuple).

It is supported in Query and QueryFirstOrDefault methods:

using (var db = CreateContext())
{
    var value = db.QueryFirstOrDefault<(int, int, int, int, int, int, int, int, int)>("SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9");
    var list = db.Query<(int, int, int, int, int, int, int, int, int)>("SELECT 1, 2, 3, 4, 5, 6, 7, 8, 9");
}

And also in Select method:

Using db = CreateDbContext()
  Dim list = db.From(Of Article).
                Select(Function(x) (x.Id, x, 1, 2, 3, 4, 5, 6, 7, 8, 9)).
                ToList()
End Using

However, latter works only in VB.NET, since C# doesn't allow that currently.

@esentio esentio merged commit e318a20 into master Aug 22, 2020
@esentio esentio deleted the feature/query branch August 22, 2020 08:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant