Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dotnet Core 3.1, EF1001: internal ef core api usage

Upgraded to Dotnet Core 3.1 from 2.2, EF core kept complaining EF1001: internal ef core api usage by putting an Exclamation Mark in my project.

But no error / warning shown during compilation. I do not know which line of code is causing the trouble.

May I know how can I find out which API / Method that I am not suppose to use?

like image 873
s k Avatar asked Feb 15 '20 03:02

s k


People also ask

What is EF core used for?

Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology. EF Core can serve as an object-relational mapper (O/RM), which: Enables . NET developers to work with a database using .

Can I use EF in .NET core?

There's currently no support for using the EF designer directly on . NET Core or . NET Standard projects.

Should I use EF6 or EF core?

Keep using EF6 if the data access code is stable and not likely to evolve or need new features. Port to EF Core if the data access code is evolving or if the app needs new features only available in EF Core. Porting to EF Core is also often done for performance.

How do I install Entity Framework in Web API core?

Right-click the Controllers folder. Select Add > New Scaffolded Item. Select API Controller with actions, using Entity Framework, and then select Add.


2 Answers

The warnings from these analyzers can be really confusing. If I understand this correctly, the issue is not what it seems.

The message with the gray warning icon inside the analyzer is normal and indicates what the analyzer is checking. See the Analyzers in Solution Explorer documentation for an explanation.

Analyzer diagnostics

If you are experiencing yellow icons on the parent node ("Analyzers") try to unload/reload the project, or maybe open Visual Studio in admin mode. See the answer to "Analyzers warnings in ASP.NET Core 2.2 project in VS2019 " for details.

If you don't see a warning in the error list then I advise you to ignore that.

The GitHub issue "Confusing analyzer warnings in solution explorer with no way to see any details" provides additional information on this.

like image 59
Rafiki Avatar answered Oct 14 '22 00:10

Rafiki


Are you using a database provider (i.e. packages for SQLServer, Postgres, etc)?

It sounds like you are saying there is some warning being given with your dependencies. I know Microsoft announced some breaking changes, mainly for database providers, with EF Core with the 3.0+ updates. Could be as simple as updating the other packages in your project.

Just guessing, I could very well be wrong.

like image 38
jdewerth Avatar answered Oct 14 '22 01:10

jdewerth