Global Data Management Forum

  • 1.  using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Mon December 14, 2020 11:33 AM
    Hi,
    I have an issue with IBM.EntityFrameworkCore 3.1.0.300 IBM Data Server provider for Entity Framework Core. I downloaded and installed this nuget packages and i want to connect my AS400 DB2 databases but i have a message : "System.TypeLoadException: Method 'Create' in type 'IBM.EntityFrameworkCore.Query.Internal.Db2SqlTranslatingExpressionVisitorFactory' from assembly 'IBM.EntityFrameworkCore, Version=3.1.0.300, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation."
    i am not sure this driver support IBM i series AS400 DB2 7.1 version?
    Does anyone have any advice on this issue.
    thanks...
    Driver: IBM.EntityFrameworkCore 1.3.0.100
    Database: IBM i series AS400 Version:V7R1M0
    OS: OS400 IDE: Visual Studio .Net 2019

    ------------------------------
    murat in
    ------------------------------

    #DataManagementGlobal
    #DataServerDrivers


  • 2.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Tue December 15, 2020 07:07 AM

    Hi,

    Thanks for contacting us. IBM EF Core 3.1.0.300 package supports IBM i series AS400 DB2 7.1 .

    By looking at the error, it seems some compatibility issue. We did investigated further and figured out this issue has been reported by other users (for Different providers) to Microsoft.

    Users had mixed application environment (Core 3.*  and .NET5) which caused the issue, and reason is - there is change in .NET5 for create(..) api of IRelationalSqlTranslatingExpressionVisitorFactory Interface. Detailed info can be found here:
    https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.query.irelationalsqltranslatingexpressionvisitorfactory?view=efcore-3.1#methods

    Please verify if due to something, .NET 5 related dependencies are being pulled ?

    If above suggestion doesn't resolve, Could you please elaborate more on the scenario ?

    If possible full stack trace and content of *.csproj file Or sample application would be best to have a close look.

    Best Regards,

    Archana



    ------------------------------
    Archana Soni
    ------------------------------



  • 3.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Tue December 15, 2020 02:26 PM
    Thanks

    ------------------------------
    Peter Shor
    ------------------------------



  • 4.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Wed December 16, 2020 07:31 AM
    Edited by System Fri January 20, 2023 04:22 PM
    Hello again
    As you tell me, I created a new .Net Core 3.1 Console Application project.
    My thought was to try connecting to the As400 database  
    but I also encountered the same error in this project (System.TypeLoadException: Method 'Create' in type 'IBM.EntityFrameworkCore.Query.Internal.Db2SqlTranslatingExpressionVisitorFactory' from assembly 'IBM.EntityFrameworkCore, Version = 3.1.0.300, Culture = neutral, PublicKeyToken = 7c30720 'does not have an implementation).
    For information, I upload the project to OneDrive and share the link with you. I would be very happy if you could help me with this subject.
    Test Project link
    https://1drv.ms/u/s!ApI_WLnvJIsEmGt7rDrfYuE-OvjP?e=ItvGOc
    Best Regards

    ------------------------------
    murat in
    ------------------------------



  • 5.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Thu December 17, 2020 05:44 AM

    Hi,

    Due to security reasons, I could not access OneDrive. I'm not sure about confidentiality of sample hence can not suggest you to upload here at public place.

    If possible, Please share content of *.csproj and steps to reproduce the issue. We will try to recreate the issue in our environment.

    But this might be time consuming process. For quick assistance please contact IBM Support Team.

    Thanks,
    Archana



    ------------------------------
    Archana Soni
    ------------------------------



  • 6.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Thu December 17, 2020 07:09 AM

    Hi,

    I solved that problem by installing pts on the As 400 machine and updating nugget packages to the project, but now this problem appeared.

    I am sharing the screenshoot of the error.

    Do we have to get a license?



    ------------------------------
    murat in
    ------------------------------



  • 7.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Thu February 18, 2021 05:30 PM
    Hello, 
    I am experiencing the same error in DB2 11.1 - Linux, It seems that error is related to the change in .Net Core 5.  It started when I added Authentication with EF 5.  
    This is my original csproj file (it works with db2):

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <Platforms>x64</Platforms>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="log4net" Version="2.0.12"/>
        <PackageReference Include="IBM.Data.DB2.Core" Version="3.1.0.400"/>
        <PackageReference Include="IBM.EntityFrameworkCore" Version="3.1.0.400"/>
        <PackageReference Include="cloudscribe.Pagination.Models" Version="1.1.0"/>
        <PackageReference Include="cloudscribe.Web.Pagination" Version="3.1.0"/>
        <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0"/>
      </ItemGroup>
    </Project>​

    And this is the new one that produced the problem:

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <Platforms>x64</Platforms>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="log4net" Version="2.0.12"/>
        <PackageReference Include="IBM.Data.DB2.Core" Version="3.1.0.400"/>
        <PackageReference Include="IBM.EntityFrameworkCore" Version="3.1.0.400"/>
        <PackageReference Include="cloudscribe.Pagination.Models" Version="1.1.0"/>
        <PackageReference Include="cloudscribe.Web.Pagination" Version="3.1.0"/>
        <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0"/>
        <PackageReference Include="Microsoft.Extensions.Identity.Core" Version="5.0.3"/>
        <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.3"/>
        <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.3"/>
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.3"/>
        <PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="2.2.0"/>
      </ItemGroup>
    </Project>​

    Then, is there any workaround available for solve this problem?.  I guess the only one for now is to downgrade to EF Code 3?

    By the way this is the error:

    TypeLoadException: Method 'Create' in type
    'IBM.EntityFrameworkCore.Query.Internal.Db2SqlTranslatingExpressionVisitorFactory' 
    from assembly 'IBM.EntityFrameworkCore, Version=3.1.0.400, Culture=neutral, 
    PublicKeyToken=7c307b91aa13d208' does not have an implementation.​


    Thanks!
    Jorge




    ------------------------------
    Jorge Jarrin
    Systems Enginner
    Personal
    ------------------------------



  • 8.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Mon February 22, 2021 02:42 AM

    Hi Jorge,

    We've recently released IBM Entity Framework Core package with .NET5 support on NuGet:

    https://www.nuget.org/packages/IBM.EntityFrameworkCore

    This should help in solving above issue..

    Thanks,
    Archana



    ------------------------------
    Archana Soni
    ------------------------------



  • 9.  RE: using IBM.EntityFrameworkCore 3.1.0.300 with AS400 i series DB2

    Posted Mon February 22, 2021 08:37 AM
    Hi, 

    Yes, it works, problem solved.

    Now my .csproj looks like this:

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <Platforms>x64</Platforms>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="log4net" Version="2.0.12"/>
        <PackageReference Include="IBM.Data.DB2.Core" Version="3.1.0.400"/>
        <PackageReference Include="IBM.EntityFrameworkCore" Version="5.0.0.200"/>
        <PackageReference Include="cloudscribe.Pagination.Models" Version="1.1.0"/>
        <PackageReference Include="cloudscribe.Web.Pagination" Version="3.1.0"/>
        <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0"/>
        <PackageReference Include="Microsoft.Extensions.Identity.Core" Version="5.0.3"/>
        <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.3"/>
        <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.3"/>
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.3"/>
        <PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="2.2.0"/>
        <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2"/>
        <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.3"/>
      </ItemGroup>
    </Project>​



    ------------------------------
    Jorge Jarrin
    Systems Enginner
    Personal
    ------------------------------