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

Support EF Core 6 #112

Closed
bricelam opened this issue Sep 22, 2021 · 3 comments · Fixed by #115
Closed

Support EF Core 6 #112

bricelam opened this issue Sep 22, 2021 · 3 comments · Fixed by #115

Comments

@bricelam
Copy link
Member

Howdy! We're starting to wind down on the EF Core 6 release, and I wanted to reach out to see if you needed any support from us.

The big new language-dependent design-time changes I can remember are:

@simon-reynolds
Copy link
Collaborator

Hi @bricelam
I've started work on EF Core 6.0 support, have NestedClosureCodeFragment support, and working on the many-to-many relationships

I also want to use the changes to ValueConverters to support null (dotnet/efcore#13850) to allow translating nullable database columns to Option types

I'll see what I can do for compiled models, creating an implementation FSharpRuntimeModelCodeGenerator might take a while. If dotnet/efcore#25110 could be a blocker then I'll see what I can hack my way around.....

@memoria-guy
Copy link

I am running into this error:

dotnet ef dbcontext scaffold "DataSource=[path]" Microsoft.EntityFrameworkCore.Sqlite

Build started...
Build succeeded.
System.MissingMethodException: Method not found: 'System.String Microsoft.EntityFrameworkCore.Design.ICSharpHelper.Fragment(Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment)'.
   at EntityFrameworkCore.FSharp.EFCoreFSharpServices.Microsoft.EntityFrameworkCore.Design.IDesignTimeServices.ConfigureDesignTimeServices(IServiceCollection services)
   at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureDesignTimeServices(Type designTimeServicesType, IServiceCollection services)
   at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureReferencedServices(IServiceCollection services, String provider)
   at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.CreateServiceCollection(String provider)
   at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(String provider)
   at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluarlize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method not found: 'System.String Microsoft.EntityFrameworkCore.Design.ICSharpHelper.Fragment(Microsoft.EntityFrameworkCore.Design.MethodCallCodeFragment)'.

And here are the Nuget package versions I am using.

<ItemGroup>
    <PackageReference Include="EntityFrameworkCore.FSharp" Version="5.0.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rtm.21519.8">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-rtm.21519.8" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rtm.21519.8">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

I think this is happening because the FSharp side of EFCore has not been updated to include the ICSharpHelper's new namespace in EF Core 6, which is Design.Internal not just Design.

@simon-reynolds
Copy link
Collaborator

Hi @memoria-guy
Version 5.0.3 only supports EF Core 5 from v5.0.3 onwards

I'm working on releasing a version for EF Core 6, I'll update here when it's ready

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

Successfully merging a pull request may close this issue.

3 participants