c# - ASP.NET CORE 2.2 使用 dotConnect for MySQL 作为提供程序和 Entity Framework 扩展 : The Provider could not be resolved

标签 c# mysql devart dotconnect entity-framework-extensions

社区,

我正在设置 Devart 的 dotConnect for MySql Provider 与 zzzprojects 的 Entity Framework 扩展。

遗憾的是,使用 AddDbContextPool 时连接不稳定。 使用AddDbContext连接稳定。

我尝试通过 options.ReplaceService 注册提供程序 但不知道我必须使用哪种类型。

我尝试显式注册服务的原因是使用“BulkSaveChangesAsync”。我收到错误“无法解析提供程序”。您必须显式设置提供程序。'

如果有人给我建议,那就太好了?

services.AddDbContextPool<DbContext>(options =>
  {   options.UseMySql(Configuration.GetConnectionString("Default"));
      options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
  });

依赖关系:

<ItemGroup>
    <PackageReference Include="AutoMapper" Version="8.0.0" />
    <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" />
    <PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.6" />
    <PackageReference Include="AWSSDK.S3" Version="3.3.31.10" />
    <PackageReference Include="CsvHelper" Version="12.1.2" />
    <PackageReference Include="Devart.Data.MySql.EFCore" Version="8.13.1402" />
    <PackageReference Include="Devart.Data.MySql.EFCore.Design" Version="8.13.1402" />
    <PackageReference Include="Microsoft.AspNetCore.All" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.4" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
    <PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="2.5.1" />
  </ItemGroup>

错误:

1.连接不稳定:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Devart.Data.MySql.MySqlConnection()
   at Devart.Data.MySql.MySqlConnection.Open()
  • 使用 Entity Framework 扩展

    无法解析提供程序。您必须明确设置提供者。 在 Z.BulkOperations.BulkOperation.() 在 Z.BulkOperations.BulkOperation.Execute() 处 在Z.BulkOperations.BulkOperation

  • 最佳答案

    免责声明:我是该项目的所有者 Entity Framework Extensions

    EF 扩展尚不支持 Devart for MySQL

    这就是您当前收到该错误的原因。我们会站在我们这边考虑并尽力支持它。

    关于c# - ASP.NET CORE 2.2 使用 dotConnect for MySQL 作为提供程序和 Entity Framework 扩展 : The Provider could not be resolved,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56619435/

    相关文章:

    php - 使用 Codeigniter 从结果集中获取值

    .net - 写入大型 BLOB 会抛出 InvalidOperationException

    delphi - Raise 错误在带有 Sybase 12.5 客户端库的 Unidac 组件中不起作用

    c# - Word Com 互操作 : Iterating all the ranges of a Word document in c#

    mysql - 从不同表中的另一列中减去一列,将答案保留在MySQL的另一列中

    c# - 将 application/x-www-form-urlencoded 发布到 SOAP/JSON WCF 服务

    php打开电子邮件客户端

    c# - 是否有 .net 驱动程序支持与 PostgreSQL 完全验证的 SSL 连接?

    c# - 使用NEST使用ElasticSearch 2.x搜索多种类型时,如何得到混合结果?

    c# - 在 C# WinForms 中为 Listbox/ListView 行的部分着色的方法?