1

We are currently migrating our ASP.NET MVC Web Application to ASP.NET Core Web Application. We have several base projects referred in our MVC Application. So in order to use the same MVC base projects in our new Core application, we planned to choose Core 2.0.

We can able to refer all the Base project built in entity framework in our Core application except our Database base project. Our database base project was built using Database first approach and contains the entity. So while referring that project, we are facing issues in using DB Context.

enter image description here

Is it possible to refer a Project which contains entity classes in .NET Core Web Application?

Dinesh M
  • 1,026
  • 8
  • 23
  • You can refer to this post, which may help you: https://stackoverflow.com/questions/38961115/build-failed-on-database-first-scaffold-dbcontext – Tupac Sep 09 '21 at 06:47

1 Answers1

0

First don't use Core 2.1 as it reached EOL. Second check the EF Core compatibility table - you can use EF Core 3.1 with .Net Framework 4.7.2+. You can also use EF 6.3 with .Net Core 3.1.
I'd recommend you to start from migrating EF 6 to EF Core 3.1 and only after that migrate ASP.Net to ASP.Net Core 3.1 or 5.0 (probably 6.0 will arrive before you finish with EF Core, if so, take it because it's going to be LTS version).
You can use both EF 6 and EF Core in same ASP.Net service so migration can be done in small chunks rather than whole DAL at once. Refer to this answer.

Artur
  • 4,595
  • 25
  • 38