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

Breaking changes in EF Core 3.0 #24

Closed
DmytroPotapov opened this issue Jun 25, 2019 · 2 comments
Closed

Breaking changes in EF Core 3.0 #24

DmytroPotapov opened this issue Jun 25, 2019 · 2 comments

Comments

@DmytroPotapov
Copy link

DmytroPotapov commented Jun 25, 2019

Do you plans to support this new EF core behavior?

The return type for several async methods has been changed from Task to ValueTask
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#the-return-type-for-several-async-methods-has-been-changed-from-task-to-valuetask
dotnet/efcore#15184

@bigshiny90
Copy link

Yes, just to add more details on this, here is an example of what is generated currently:

public static Task<Entity> GetByKeyAsync(this IQueryable<Entity> queryable, decimal id)
{
  if (queryable is DbSet<Entity> dbSet)
    return dbSet.FindAsync(id);

    return queryable.FirstOrDefaultAsync(q => q.id == id);
}

would simply need to become:

public static async Task<Entity> GetByKeyAsync(this IQueryable<Entity> queryable, decimal id)
{
  if (queryable is DbSet<Entity> dbSet)
    return await dbSet.FindAsync(id);

    return await queryable.FirstOrDefaultAsync(q => q.id == id);
}

Great tool by the way! Thanks for putting it together. I'm sure we're all waiting for final net core 3 release before dealing with issues like this ;)

@pwelter34
Copy link
Member

The generated code in now compatible with EF Core 3.0 in version 2.0 of efg

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

3 participants