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

Npgsql+IncludeOptimized: fixes "System.NotSupportedException: CLR type System.Object isn't supported #407

Conversation

ericdagenais
Copy link
Contributor

Fixes "System.NotSupportedException: CLR type System.Object isn't supported by Npgsql" type exceptions when using IncludeOptimized with Npgsql and a query that employs a x => array.Contains(x.Id) type expression.

This commit fixes the following use case which would previously throw the above System.NotSupportedException when using Npgsql (a .NET Postgres client SDK):

var ids = new Guid [] { Guid.Parse("838de2e2-d18d-49d1-8f03-7351a6e99a55d"), Guid.Parse("9380a5dc-ceb6-4fa4-a30b-a583d1ba00b") };
var entities = await _dbContext.MainRows
    .Where(x => ids.Contains(x.Id))
    .IncludeOptimized(x => x.ChildRows)
    .ToListAsync();

…ported by Npgsql" type exceptions when using IncludeOptimized with Npgsql and a query that employs a `x => array.Contains(x.Id)` type expression.

This commit fixes the following use case which would previously throw the above System.NotSupportedException when using Npgsql (a .NET Postgres client SDK):
```
var ids = new Guid [] { Guid.Parse("838de2e2-d18d-49d1-8f03-7351a6e99a55d"), Guid.Parse("9380a5dc-ceb6-4fa4-a30b-a583d1ba00b") };
var entities = await _dbContext.MainRows
    .Where(x => ids.Contains(x.Id))
    .IncludeOptimized(x => x.ChildRows)
    .ToListAsync();
```
@JonathanMagnan JonathanMagnan self-assigned this Sep 10, 2018
@JonathanMagnan
Copy link
Member

Hello @ericdagenais ,

Thank for the pull, we will review this week.

Best Regards,

Jonathan

@JonathanMagnan JonathanMagnan merged commit 6dd2331 into zzzprojects:master Sep 15, 2018
@JonathanMagnan
Copy link
Member

Hello @ericdagenais ,

Thank a lot for your pull,

A new version should be released very soon with this change.

Best Regards,

Jonathan

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

Successfully merging this pull request may close these issues.

None yet

2 participants