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

Entity Framework Core 8 (.NET 8) Support #39

Closed
SerhiyBalan opened this issue Nov 21, 2023 · 7 comments
Closed

Entity Framework Core 8 (.NET 8) Support #39

SerhiyBalan opened this issue Nov 21, 2023 · 7 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@SerhiyBalan
Copy link

Do you plan to release a version with native support of Entity Framework Core 8 ?

Thank you very much

@yv989c
Copy link
Owner

yv989c commented Nov 21, 2023

Hey @SerhiyBalan. Yes, as soon as I have a chance. In the meantime you can use v7.

Are you experiencing any issues with v7.4?

@SerhiyBalan
Copy link
Author

@yv989c thank you for the quick reply

At first glance, it works well - no crashes, seems to return legit results.

I haven't run the tests you have. So I can't say for sure that everything works 100%

I just wanted to receive a sign of approval that it is EF Core 8 comparable.

Thanks :)

@mboud
Copy link

mboud commented Nov 23, 2023

Hi @yv989c ! I've switched to .Net 8 / EF Core 8 and I get this kind of error with v7.4 of the package:

Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'A'. Invalid column name 'A1'. Invalid column name 'A2'. Invalid column name 'A3'. Invalid column name 'A4'. Invalid column name 'A5'. Invalid column name 'A6'. Invalid column name 'A7'. Invalid column name 'A8'. Invalid column name 'A9'. Invalid column name 'B'. Invalid column name 'B1'. Invalid column name 'B2'. Invalid column name 'B3'. Invalid column name 'B4'. Invalid column name 'B5'. Invalid column name 'B6'. Invalid column name 'B7'. Invalid column name 'B8'. Invalid column name 'B9'. Invalid column name 'C'. Invalid column name 'C1'. Invalid column name 'C2'. Invalid column name 'C3'. Invalid column name 'C4'. Invalid column name 'C5'. Invalid column name 'C6'. Invalid column name 'C7'. Invalid column name 'C8'. Invalid column name 'C9'. Invalid column name 'D'. Invalid column name 'D1'. Invalid column name 'D2'. Invalid column name 'D3'. Invalid column name 'D4'. Invalid column name 'D5'. Invalid column name 'D6'. Invalid column name 'D7'. Invalid column name 'D8'. Invalid column name 'D9'. Invalid column name 'E'. Invalid column name 'E1'. Invalid column name 'E2'. Invalid column name 'E3'. Invalid column name 'E4'. Invalid column name 'E5'. Invalid column name 'E6'. Invalid column name 'E7'. Invalid column name 'E8'. Invalid column name 'E9'. Invalid column name 'F'. Invalid column name 'F1'. Invalid column name 'F2'. Invalid column name 'F3'. Invalid column name 'F4'. Invalid column name 'F5'. Invalid column name 'F6'. Invalid column name 'F7'. Invalid column name 'F8'. Invalid column name 'F9'. Invalid column name 'G1'. Invalid column name 'G2'. Invalid column name 'G3'. Invalid column name 'G4'. Invalid column name 'G5'. Invalid column name 'G6'. Invalid column name 'G7'. Invalid column name 'G8'. Invalid column name 'G9'. Invalid column name 'H'. Invalid column name 'H1'. Invalid column name 'H2'. Invalid column name 'H3'. Invalid column name 'H4'. Invalid column name 'H5'. Invalid column name 'H6'. Invalid column name 'H7'. Invalid column name 'H8'. Invalid column name 'H9'. Invalid column name 'I'. Invalid column name 'I1'. Invalid column name 'I2'. Invalid column name 'I3'. Invalid column name 'I4'. Invalid column name 'I5'. Invalid column name 'I6'. Invalid column name 'I7'. Invalid column name 'I8'. Invalid column name 'I9'. Invalid column name 'L'. Invalid column name 'L1'. Invalid column name 'L2'. Invalid column name 'L3'. Invalid column name 'L4'. Invalid column name 'L5'. Invalid column name 'L6'. Invalid column name 'L7'. Invalid column name 'L8'. Invalid column name 'L9'. Invalid column name 'M'. Invalid column name 'M1'. Invalid column name 'M2'. Invalid column name 'M3'. Invalid column name 'M4'. Invalid column name 'M5'. Invalid column name 'M6'. Invalid column name 'M7'. Invalid column name 'M8'. Invalid column name 'M9'. Invalid column name 'S'. Invalid column name 'S1'. Invalid column name 'S2'. Invalid column name 'S3'. Invalid column name 'S4'. Invalid column name 'S5'. Invalid column name 'S6'. Invalid column name 'S7'. Invalid column name 'S8'. Invalid column name 'S9'. Invalid column name 'Y'. Invalid column name 'Y1'. Invalid column name 'Y2'. Invalid column name 'Y3'. Invalid column name 'Y4'. Invalid column name 'Y5'. Invalid column name 'Y6'. Invalid column name 'Y7'. Invalid column name 'Y8'. Invalid column name 'Y9'.

So for me, v7.4 is not EF Core 8 compatible (could be a bad usage on my side though).

To illustrate, here's the syntax of the method that throws this error.

public IReadOnlyCollection<IMainAddress> FindFromAccountIds(ISet<Guid> accountIds)
{
    IQueryable<Guid> mainAddressIds = this._dbContext.Accounts
        .Join(
            this._dbContext.AsQueryableValues(accountIds),
            account => account.Id,
            accountId => accountId,
            (account, accountId) => account.MainAddressId);

    return this.dbContext.MainAddresses
        .Join(
            mainAddressIds,
            mainAddress => mainAddress.Id,
            mainAddressId => mainAddressId,
            (mainAddress, mainAddressId) => mainAddress)
        .ToArray();
}

@yv989c
Copy link
Owner

yv989c commented Nov 23, 2023

Thanks for reporting this, @mboud. I'll spend some time on it this weekend.

@yv989c
Copy link
Owner

yv989c commented Nov 23, 2023

Hey @mboud, I can reproduce this bug under EF 7.x as well, so it isn't specific to EF 8.0. I have an idea of how to fix it.

In the meantime, you can workaround the issue by refactoring your query like this:

public IReadOnlyCollection<IMainAddress> FindFromAccountIds(ISet<Guid> accountIds)
{
    return this._dbContext.Accounts
        .Join(
            this._dbContext.AsQueryableValues(accountIds),
            account => account.Id,
            accountId => accountId,
            (account, accountId) => account.MainAddressId
        )
        .Join(
            this._dbContext.MainAddresses,
            mainAddressId => mainAddressId,
            mainAddress => mainAddress.Id,
            (mainAddress, mainAddressId) => mainAddress
        )
        .ToList();
}

@SerhiyBalan, I started working on a version of QV for EF 8.0 and all the integration tests are passing without any code changes, therefore, you are good with v7.4:
image

Once I have a solution for the unsupported case above –aka bug– I'll release the specific version of QV for EF 8.0 – which will target net8.0.

@yv989c yv989c added bug Something isn't working enhancement New feature or request labels Nov 23, 2023
@mboud
Copy link

mboud commented Nov 24, 2023

Hi @yv989c ! I was using v6.x + EF Core 6 before and jumped to v7.4 + EF Core 8 hence my believing it was related to EF Core 8. Thanks for sorting this out so fast. I can still wait a bit before switching to EF Core 8 so I'll wait for future updates.

Again, thanks a lot !

@yv989c
Copy link
Owner

yv989c commented Nov 26, 2023

This has been fixed in #41.

@yv989c yv989c closed this as completed Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants