谁能提供.NET CORE 连接 db2 数据库的 例子在线等等,如果解决问题令送分
目前我 .net core 连接 db2 数据库 总是存在问题,有没有厉害大牛提供一个例子,不胜感激。
以下是环境,总是存在问题:
db2 数据库组件:ibm.data.db2.core 版本(1.3.0.100)
ibm.EntityFrameworkCore(1.3.0.100)
db2 数据库: 安装的产品:DB2 Express-C - DB2COPY1, 版本:DB2/NT64 10.1.0
以下是EF CODE FIRST 命中遇到的错误提示,好像版本有问题一样
Add-Migration Initial
System.TypeLoadException: Method 'get_Info' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
at IBM.EntityFrameworkCore.Db2DbContextOptionsExtensions.UseDb2
at ConsoleApp1.Models.OderDbContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder) in C:\Users\86186\source\repos\ConsoleApp1\ConsoleApp1\Models\OderDbContext.cs:line 18
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func`1 factory)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method 'get_Info' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
PM> Add-Migration Initial