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

Parameters don't work with VB.NET #3109

Closed
sorenjakobsen opened this issue Feb 22, 2024 · 6 comments
Closed

Parameters don't work with VB.NET #3109

sorenjakobsen opened this issue Feb 22, 2024 · 6 comments

Comments

@sorenjakobsen
Copy link

Basic VB.NET/LINQ queries such as the following do not seem to work with efcore.pg.

Dim email = "[email protected]"
Dim p = (New MyDbContext).Person.Single(Function(x) x.Email = email)

I get the following error message.

'42703: column "__$vb$local_email_0" does not exist
@roji
Copy link
Member

roji commented Feb 22, 2024

@sorenjakobsen can you please open this in the EF repo? This doesn't seem like something that's specific to the PG provider.

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
@sorenjakobsen
Copy link
Author

I don't have this problem with the standard SQL Server provider, so I don't think it is a general EF problem?

@roji
Copy link
Member

roji commented Feb 23, 2024

@sorenjakobsen then can you please post a minimal, runnable VB console program that fails when using PostgreSQL, but works when using SQL Server?

@sorenjakobsen
Copy link
Author

@roji yes, here is an example, should be runnable with Visual Studio (Community) 2022.

ConsoleApp2.zip

@roji
Copy link
Member

roji commented Feb 23, 2024

Thanks, I'll take a look at this soon.

@roji roji reopened this Feb 23, 2024
@roji roji changed the title VB.NET support Parameters don't work with VB.NET Feb 24, 2024
@roji
Copy link
Member

roji commented Feb 24, 2024

Thanks @sorenjakobsen, I could reproduce the problem thanks to your code sample and understand the problem - it's a somewhat complex interplay between how the VB compiler names captured members, and how Npgsql/PG handle parameter names. I've opened dotnet/efcore#33150 to fix this on the EF side, and have submitted dotnet/efcore#33151 to fix it. Unfortunately, it's unlikely the fix will make it into 8.0 (this is the first time we've had this bug raised, so very few people seem to be trying VB with EF and PG).

I'll go ahead and close this issue here - you can comment on dotnet/efcore#33150.

@roji roji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
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