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

Ardalis.SmartEnum.EFCore and Entity Framework Core v6 #201

Closed
BenWhite27 opened this issue Nov 26, 2021 · 4 comments · Fixed by #203
Closed

Ardalis.SmartEnum.EFCore and Entity Framework Core v6 #201

BenWhite27 opened this issue Nov 26, 2021 · 4 comments · Fixed by #203
Assignees

Comments

@BenWhite27
Copy link

BenWhite27 commented Nov 26, 2021

It appears some API's were changed in EFCore v6 which means we now get a MissingMethodException when calling ConfigureSmartEnum()

Specifically this commit seems to be the one that has the changes, dotnet/efcore@9a8c6c7#diff-c60aa50a5ed91b1d551a38d9499f85573f144b164f5adf192ef265a368c504f2
Looks like they swapped out some interface definitions for new ones, ITypeBase is now IReadOnlyTypeBase

I would imagine a version bump in the package dependencies is all that's required to fix it.

System.MissingMethodException: Method not found: 'System.Type Microsoft.EntityFrameworkCore.Metadata.ITypeBase.get_ClrType()'.
   at SmartEnum.EFCore.SmartEnumConverterExtensions.ConfigureSmartEnum(ModelBuilder modelBuilder)
   at My.Namespace.Infrastructure.Data.MyDbContext.OnModelCreating(ModelBuilder modelBuilder)
@samuelwine
Copy link
Contributor

@ardalis is this something I could help with to fix?

@ardalis
Copy link
Owner

ardalis commented Dec 9, 2021

Sure, go for it.

@nagasudhirpulla
Copy link
Contributor

Hi, I am getting the same error when ConfigureSmartEnum method is executed in a project where I am using dotnet 6 with SmartEnum.EfCore
Please resolve this issue

@mgraf1
Copy link
Contributor

mgraf1 commented Feb 24, 2022

@ardalis any chance we could get a new release with these changes? Thanks!

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

Successfully merging a pull request may close this issue.

5 participants