错误:该方法或操作未实现.在搭建MYSQL数据库时

编程入门 行业动态 更新时间:2024-10-26 01:27:05
本文介绍了错误:该方法或操作未实现.在搭建MYSQL数据库时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用 core 2.0.我已经安装了以下nuget软件包: 1:Microsoft.AspNetCore.All 2:Microsoft.EntityFrameworkCore.Tools 3:MySql.Data.EntityFrameworkCore 4:MySql.Data.EntityFrameworkCore.Design

I'm using core 2.0. I have installed the following nuget Packages: 1: Microsoft.AspNetCore.All 2: Microsoft.EntityFrameworkCore.Tools 3: MySql.Data.EntityFrameworkCore 4: MySql.Data.EntityFrameworkCore.Design

当我尝试在包管理器控制台中使用以下命令来搭建数据库时

When I try to scaffold the database using the following command in the package manager console

Scaffold-DbContext "server=localhost;port=3306;user=root;password=mypass;database=SampleDB" MySql.Data.EntityFrameworkCore -OutputDir SampleEFMySQL -f

我收到以下错误消息.

System.NotImplementedException: The method or operation is not implemented. at MySql.Data.EntityFrameworkCore.Scaffolding.Internal.MySQLDatabaseModelFactory.Create(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.Create(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, Boolean useDatabaseNames) at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ModelScaffolder.Generate(String connectionString, IEnumerable`1 tables, IEnumerable`1 schemas, String projectPath, String outputPath, String rootNamespace, String contextName, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames) at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_1.<.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) The method or operation is not implemented.

我如何使用Entity Framwork Core(在 core 2.0中)使用MySQL

How do I work with MySQL using Entity Framwork Core(in core 2.0)

推荐答案

这似乎是Connector/NET中的错误:错误89310 ,也报告为错误90368 .

This appears to be a bug in Connector/NET: bug 89310, also reported as bug 90368.

许多人(例如,此处和此处)建议切换到 Pomelo .EntityFrameworkCore.MySql 代替(将MySQL与.NET Core上的Entity Framework Core一起使用).

Many people (e.g., here and here) recommend switching to Pomelo.EntityFrameworkCore.MySql instead (to use MySQL with Entity Framework Core on .NET Core).

更多推荐

错误:该方法或操作未实现.在搭建MYSQL数据库时

本文发布于:2023-11-14 19:09:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1588288.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   操作   数据库   方法   MYSQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!