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

EF Core 9 support #1841

Open
lauxjpn opened this issue Feb 13, 2024 · 80 comments
Open

EF Core 9 support #1841

lauxjpn opened this issue Feb 13, 2024 · 80 comments
Assignees
Milestone

Comments

@lauxjpn
Copy link
Collaborator

lauxjpn commented Feb 13, 2024

We will use this issue to track the progress on supporting EF Core 9, including its previews.

@lauxjpn lauxjpn added this to the 9.0.0 milestone Feb 13, 2024
@lauxjpn lauxjpn self-assigned this Feb 13, 2024
@lauxjpn lauxjpn pinned this issue Feb 13, 2024
@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Feb 28, 2024

Prerelease 9.0.0-preview.1 (compatible with EF Core 9.0.0-preview.1.24081.2) is now available on nuget.org.

@rodolforeinaperficient
Copy link

rodolforeinaperficient commented Aug 5, 2024

Hi @lauxjpn, do you have any plans to update to 9.0.0-preview.5?

@ysmoradi
Copy link

Hi @lauxjpn, do you have any plans to update to 9.0.0-preview.5?

The same for .NET 9 preview7 ?

@dajma00
Copy link

dajma00 commented Sep 14, 2024

I think we need a release for .NET 9, RC1. I get this error:
image

@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Sep 14, 2024

An EF Core 9 RC compatible Pomelo release will be out in about 2-3 weeks.

@dajma00
Copy link

dajma00 commented Oct 11, 2024

Anyone else getting this both with Pomelo RC1 and RC2, .NET9 RC2:
image

@glennawatson
Copy link

Anyone else getting this both with Pomelo RC1 and RC2, .NET9 RC2: image

Yeah, seems to be more members were added in the RC vs the preview in entity framework itself.

@bkoelman
Copy link

@lauxjpn Can we please get a NuGet release that's compatible with RC2 soon? I'd like to run our 9000+ test suite against it. I don't mind using the pomelo-nightly feed.

@raffidahmad
Copy link

Hi, what's the timeline for a RC2 compatible release?

@siriak
Copy link

siriak commented Nov 12, 2024

Looking forward to .NET 9 version 👀

@bdovaz
Copy link

bdovaz commented Nov 13, 2024

One of the problems of this library that I see with respect to others of the same type is that it forces a range of versions that makes it impossible to use it in versions +1 of .NET...

https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/blob/main/Dependencies.targets#L3

If it didn't do that at least we could get to use it “theoretically” if there are no breaking changes in EF Core that shouldn't because of Microsoft policies...

But because of the decision to use ranges in the EF Core dependency, we always depend on a new stable release specific for that version...

Mongo for example does not do it so we can use that same version with EF Core 9.x (which would be the logical thing with Pomelo)

Another example: https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL/8.0.10#dependencies-body-tab

@bkoelman
Copy link

@bdovaz I think there are breaking changes in EF Core 9, in the pubternal types that providers need to implement. That's why suppressing the version range warning doesn't make it work.

@bdovaz
Copy link

bdovaz commented Nov 13, 2024

@bkoelman I mean that “maybe not always” there are breaking changes that affect this library between major versions and that it is limiting by default its use

@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Nov 13, 2024

I will try to get a compatible version out early next week (I am very much swamped this week, so earlier will just not be possible). While this prerelease will be compatible with EF Core 9, it will probably not contain a lot of the new EF Core 9 features yet.


But because of the decision to use ranges in the EF Core dependency, we always depend on a new stable release specific for that version...

@bdovaz That is a deliberate decision (doesn't have to be stable though). Every major EF Core release contains breaking changes and is incompatible with provider releases that target any preceding major version.

@Emiliowilvca

This comment was marked as off-topic.

@glennawatson
Copy link

when is version 9.0.0 released?

He just replied above your message. He's hoping this week but swamped

@kuerhero

This comment was marked as duplicate.

@fairok
Copy link

fairok commented Nov 18, 2024

When will efcore9.0 be supported?

Maybe early in this week, please refer the above message.

@CardenInsurance
Copy link

I installed the version "9.0.0-preview.2.ci.20240426151710" from DevOps repo and when I run my app, it gives me this error: Could not load type 'Microsoft.EntityFrameworkCore.TypeBaseExtensions' from assembly 'Microsoft.EntityFrameworkCore, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

I understand this is not GA version but didn't know if I'm doing something wrong or not. Is this expected?

20240426151710 is not the latest version available. Look for 20241207210245 or newer.

@anoori-opus
Copy link

Thank you. That worked. I don't know why it didn't show up on the feed in the GUI so I installed it using command line.

@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Dec 13, 2024

Prerelease 9.0.0-preview.2.efcore.9.0.0 (compatible with EF Core 9.0.x) is now available on nuget.org.

@ErikEJ
Copy link

ErikEJ commented Dec 13, 2024

@lauxjpn Amazing - I will get it added to EF Core Power Tools ASAP!

@iccfish
Copy link

iccfish commented Dec 16, 2024

With 9.0.0-preview.2.efcore.9.0.0 the following query can not work anymore:

var uids = new ulong[0]{};
var users = await this.dbContext.Users.Where(s=>uids.Contains(s.Uid)).ToListAsync();

The codes above works ok with 8.0.11.
Exception was:

      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: The LINQ expression '@__uids_0' could not be translated. Additional information: Primitive collections support has not been enabled. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
         at Pomelo.EntityFrameworkCore.MySql.Query.Internal.MySqlQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection(SqlExpression sqlExpression, IProperty property, String tableAlias)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateParameterQueryRoot(ParameterQueryRootExpression parameterQueryRootExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.TranslateSubquery(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.<VisitMethodCall>g__TranslateAsSubquery|33_0(Expression expression, <>c__DisplayClass33_0&)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.CallBaseVisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.TranslateInternal(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.<ExecuteCore>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
         at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

@miroslavpopovic
Copy link

miroslavpopovic commented Dec 16, 2024

With 9.0.0-preview.2.efcore.9.0.0 the following query can not work anymore:

var uids = new ulong[0]{};
var users = await this.dbContext.Users.Where(s=>uids.Contains(s.Uid)).ToListAsync();

The codes above works ok with 8.0.11. Exception was:

      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: The LINQ expression '@__uids_0' could not be translated. Additional information: Primitive collections support has not been enabled. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
         at Pomelo.EntityFrameworkCore.MySql.Query.Internal.MySqlQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection(SqlExpression sqlExpression, IProperty property, String tableAlias)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateParameterQueryRoot(ParameterQueryRootExpression parameterQueryRootExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.TranslateSubquery(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.<VisitMethodCall>g__TranslateAsSubquery|33_0(Expression expression, <>c__DisplayClass33_0&)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.CallBaseVisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.TranslateInternal(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.<ExecuteCore>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
         at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

The same thing happens to me too for simple queries that should produce WHERE IN SQL. I.e., something like:

// List<Guid> userIds = [Guid.NewGuid()];

var users = await dbContext.Users
    .Where(x => userIds.Contains(x.Id))
    .ToListAsync();

@raffidahmad
Copy link

yup have noticed the same, before i thought it was because pomelo was on preview 1

@devnullue
Copy link

With 9.0.0-preview.2.efcore.9.0.0 the following query can not work anymore:

var uids = new ulong[0]{};
var users = await this.dbContext.Users.Where(s=>uids.Contains(s.Uid)).ToListAsync();

The codes above works ok with 8.0.11. Exception was:

      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: The LINQ expression '@__uids_0' could not be translated. Additional information: Primitive collections support has not been enabled. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
         at Pomelo.EntityFrameworkCore.MySql.Query.Internal.MySqlQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection(SqlExpression sqlExpression, IProperty property, String tableAlias)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateParameterQueryRoot(ParameterQueryRootExpression parameterQueryRootExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitExtension(Expression extensionExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.TranslateSubquery(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.<VisitMethodCall>g__TranslateAsSubquery|33_0(Expression expression, <>c__DisplayClass33_0&)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.CallBaseVisitMethodCall(MethodCallExpression methodCallExpression)
         at Pomelo.EntityFrameworkCore.MySql.Query.ExpressionVisitors.Internal.MySqlSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.TranslateInternal(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.Translate(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateExpression(Expression expression, Boolean applyDefaultTypeMapping)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateLambdaExpression(ShapedQueryExpression shapedQueryExpression, LambdaExpression lambdaExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
         at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.<ExecuteCore>b__0()
         at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
         at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
         at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

A solution is mentioned here:
#1960

EnablePrimitiveCollectionsSupport() and TranslateParameterizedCollectionsToConstants()
was needed to fix it for me

@miroslavpopovic
Copy link

miroslavpopovic commented Dec 16, 2024

Thanks, @devnullue, I should have looked for existing issues first. Yes, with just TranslateParameterizedCollectionsToConstants, all our integration tests are passing.

And big thanks to @lauxjpn for all the hard work on this!

@jossean-rivera
Copy link

Hi, is there any estimates on when you would publish a stable EF Core 9.0 version? We've been following this issue since November.

@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Jan 7, 2025

Hi, is there any estimates on when you would publish a stable EF Core 9.0 version? We've been following this issue since November.

@jossean-rivera Our Schedule and Roadmap is up-to-date, so we still plan to release the 9.0 GA version in January.

@CollinHerber
Copy link

CollinHerber commented Jan 23, 2025

We are nearing the end of January and my team is scheduled for .NET 9 upgrades for the next sprint (Start of February) from these initial release notes. Are we still on track for that or should I pivot?
We are just waiting on Pomelo.EntityFrameworkCore GA at this time.

@rowanfuchs
Copy link

We are nearing the end of January and my team is scheduled for .NET 9 upgrades for the next sprint (Start of February) from these initial release notes. Are we still on track for that or should I pivot? We are just waiting on Pomelo.EntityFrameworkCore GA at this time.

Have your team contribute to the package, that should definitely speed things up.

@raffidahmad
Copy link

I'm facing a weird issue, in version 8 the Column order annotation was working as expected, it still works but the following does not seem to work anymore for me
[Column(Order = 99999)] [Timestamp] public DateTime UpdatedDate { get; set; }
This does not seem to work anymore in migrations and is causing these columns to appear first even

@enisn

This comment has been minimized.

@MeikelLP
Copy link

You people are poison for the open source community. Just taking and demanding for free, not even giving anything back.
Please just leave.

You can still use the EF Core 8 version which runs on the LTS .NET8 so you don't have to use EF Core 9.
You can use EF Core 8 in .NET 9 applications.

@mc2002tii
Copy link

mc2002tii commented Jan 31, 2025

@MeikelLP, my two cents is that it isn't the delays that are the problem. It is the lack of communication about the delays. And the same thing happens every year with this project. (and I'm not trying to defend enisn's obnoxious image; that doesn't help anything).

@zijianhuang
Copy link

zijianhuang commented Jan 31, 2025

I have been using the Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.2.efcore.9.0.0 for many weeks in production.

  1. As said by many above, "You can still use the EF Core 8 version which runs on the LTS .NET8 so you don't have to use EF Core 9.
    You can use EF Core 8 in .NET 9 applications.", provided:
    a. You have proper branching strategy.
    b. You don't feel annoyed when package management of VS IDE keeps prompting you to grade to .NET 9 complaint components like EF Core 9.

I have comprehensive test suites for the DAL, so I am fairly confident Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.2.efcore.9.0.0 won't break my app --- I won't say it won't break yours since my app is probably not complicated enough to encounter the edge cases you have experienced.

A trick when using 9.0.0-preview.2.efcore.9.0.0 is, you may need to explicitly reference Microsoft.EntityFrameworkCore.Relational or Microsoft.EntityFrameworkCore 9 or 9.01 in some of your csproj files when the compiler or runtime MIGHT complains downgrading of the package.

@miroslavpopovic
Copy link

I can also confirm that version 9.0.0-preview.2.efcore.9.0.0 works quite fine in production, although we don't have a lot of complex queries.

And I, too, don't see a point in constant nagging about the final version. It will be out once it's ready. Writing and maintaining EF Core provider for free is not an easy task. Sooner or later, life catches up, especially if you are (more or less) the only person maintaining a huge codebase. We should be thankful for things moving on at all, or jump in to help - it is open-source, after all.

For those concerned about the stability and the release cadence, you can try to migrate to another database. In our case, we don't have technical but business obstacle. We are trying to push the management to make the transition to Postgres, but they are a bit reluctant at this point, since that means another software to maintain by the infra team.

@MeikelLP
Copy link

MeikelLP commented Feb 1, 2025

   b. You don't feel annoyed when package management of VS IDE keeps prompting you to grade to .NET 9 complaint 

@zijianhuang: You can use version ranges to prevent that: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning?tabs=semver20sort#version-ranges VS should not warn you then. Very useful tip I learned recently with FluentAssertions the fiasco

@MeikelLP, my two cents is that it isn't the delays that are the problem. It is the lack of communication about the delays. And the same thing happens every year with this project. (and I'm not trying to defend enisn's obnoxious image; that doesn't help anything).

@mc2002tii This is still a free (most likely hobbyish) project from some people from the internet. They are not required to implement anything. It's a blessing they do it for free. Oracle is worse even though they are paid. Also they are developer not PR guys. The are not required be transparent to respond at all. If you don't like them: Fork the project. That's the OSS spirit.

@boeschenstein
Copy link

Update Pomelo.EntityFrameworkCore.MySql from 8.0.2 to 9.0.0-preview.2.efcore.9.0.0

We have a "Contains" using an 'enum' in our query, which runs fine in version v8.0.2, but fails in v9:

public LoadDataSpecification(Guid mandatorId, List<ServiceType> serviceTypes)
    : base(f => f.MandatorId.Equals(mandatorId) && serviceTypes.Contains(f.ServiceType));

Without "Contains" this query runs fine in v9 as well:

public LoadDataSpecification(Guid mandatorId, List<ServiceType> serviceTypes)
    : base(f => f.MandatorId.Equals(mandatorId));

So can you please support "Contains" in v9, as well?

Result:
System.InvalidOperationException
HResult=0x80131509
Message=The LINQ expression '@__serviceTypes_1' could not be translated. 
Additional information: Primitive collections support has not been enabled. 
Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'.
See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Source=Pomelo.EntityFrameworkCore.MySql
StackTrace:
at Pomelo.EntityFrameworkCore.MySql.Query.Internal.MySqlQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection(SqlExpression sqlExpression, IProperty property, String tableAlias)

@miroslavpopovic
Copy link

Update Pomelo.EntityFrameworkCore.MySql from 8.0.2 to 9.0.0-preview.2.efcore.9.0.0

We have a "Contains" using an 'enum' in our query, which runs fine in version v8.0.2, but fails in v9:

public LoadDataSpecification(Guid mandatorId, List serviceTypes)
: base(f => f.MandatorId.Equals(mandatorId) && serviceTypes.Contains(f.ServiceType));

Without "Contains" this query runs fine in v9 as well:

public LoadDataSpecification(Guid mandatorId, List serviceTypes)
: base(f => f.MandatorId.Equals(mandatorId));

So can you please support "Contains" in v9, as well?

Result:
System.InvalidOperationException
HResult=0x80131509
Message=The LINQ expression '@__serviceTypes_1' could not be translated.
Additional information: Primitive collections support has not been enabled.
Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'.
See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Source=Pomelo.EntityFrameworkCore.MySql
StackTrace:
at Pomelo.EntityFrameworkCore.MySql.Query.Internal.MySqlQueryableMethodTranslatingExpressionVisitor.TranslatePrimitiveCollection(SqlExpression sqlExpression, IProperty property, String tableAlias)

@boeschenstein, this has been referenced in the past comments. I have asked the same question, and @devnullue has pointed me to #1960. Adding option .TranslateParameterizedCollectionsToConstants() during MySQL configuration helped.

@Donistivanov
Copy link

Donistivanov commented Feb 4, 2025

Is anyone having trouble with seeding data the new way (https://learn.microsoft.com/en-us/ef/core/modeling/data-seeding#configuration-options-useseeding-and-useasyncseeding-methods)?

I am getting:

fail: Microsoft.EntityFrameworkCore.Database.Transaction[20205]
      An error occurred using a transaction.
An error occurred using a transaction.
MySqlConnector.MySqlException (0x80004005): SAVEPOINT __EFSavePoint does not exist
   at MySqlConnector.Core.ServerSession.ReceiveReplyAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 1081
   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 37
   at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 131
   at MySqlConnector.MySqlDataReader.InitAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 487
   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 56
   at MySqlConnector.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 309
   at MySqlConnector.MySqlCommand.ExecuteNonQuery() in /_/src/MySqlConnector/MySqlCommand.cs:line 108
   at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.ReleaseSavepoint(String name)

Troubleshooting steps: dotnet/efcore#33319 (comment)

Additional research:
mysql-net/MySqlConnector#1216

@srad
Copy link

srad commented Feb 18, 2025

@MeikelLP, my two cents is that it isn't the delays that are the problem. It is the lack of communication about the delays. And the same thing happens every year with this project. (and I'm not trying to defend enisn's obnoxious image; that doesn't help anything).

I already mentioned that people (and I) would be willing to donate time. However, the project is under-documneted and not in a shape which would allow any outsider to help out or dig into the code with a reasonable amount of effort.

This project needs new direction in order to involve more people to help out. We can't just have one or two people be blockers and the single point of failure for such an important project

@lauxjpn
Copy link
Collaborator Author

lauxjpn commented Feb 20, 2025

I have time on my hands again, probably until the end of summer. So we should be able to release the GA version in March.

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

No branches or pull requests