问题
Not having a great time.
PM> command run
Scaffold-DbContext "Server=myserver;Database=mysqlserverdb;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -Tables Settings -verbose
Error:
The method or operation is not implemented.
System.NotImplementedException: The method or operation is not implemented.
at Microsoft.EntityFrameworkCore.Scaffolding.ProviderCodeGenerator.GenerateUseProvider(String connectionString)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpDbContextGenerator.GenerateOnConfiguring(String connectionString, Boolean suppressConnectionStringWarning)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpDbContextGenerator.GenerateClass(IModel model, String contextName, String connectionString, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpDbContextGenerator.WriteCode(IModel model, String namespace, String contextName, String connectionString, Boolean useDataAnnotations, Boolean suppressConnectionStringWarning)
at Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpModelGenerator.GenerateModel(IModel model, String namespace, String contextDir, String contextName, String connectionString, ModelCodeGenerationOptions options)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable
1 schemas, IEnumerable1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable
1 schemaFilters, IEnumerable1 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.b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)`
回答1:
Between installing the EF power Tools and the Latest Core 2.2.x.x SDK I am now able to change my project to use dropdown change to the .net core 2.2 (it was previously only able to do 2.1.
Then with Nuget updates etc.. , it finally works!
来源:https://stackoverflow.com/questions/53877278/scaffold-dbcontext-the-method-or-operation-is-not-implemented