1
votes

I have created a .NET Core 3.0 class library project, and would like to use Entity Framework in it.

I have installed Entity Framework Core using Nuget, and also have .NET Core 3.0 SDK installed on my computer, but I still don't see the ADO.net Entity Data Model template when I try to add a new item to the project.

I am using Visual Studio 2019 Community.

2
I guess you have to use some other extension like the EF Core Power Tools...Peter Schneider
if you are creating DB context from the existing database you need to use scaffolding to do that. refer entityframeworktutorial.net/efcore/… for more infoArjun Vachhani
Deleting questions while people are trying to answer is annoying. Check the Microsoft API Versioning libraries, they may already do what you want.Panagiotis Kanavos
The API Documentation Wiki in that repo explains how to use the packages, how to handle versioning in general and how to configure the library to use specific versions, including how to set the default API versionPanagiotis Kanavos

2 Answers

0
votes

I was able to scaffold my entities by running dotnet-ef command line. Install the following package first :

> dotnet add package Microsoft.EntityFrameworkCore.SqlServer
> dotnet add package Microsoft.EntityFrameworkCore.Design

And the dotnet-ef tool :

> dotnet tool install --global dotnet-ef

Then issue the below command :

> dotnet-ef dbcontext scaffold "Data Source=your_server_instance;Database=your_db;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o Model

Please have a look at this : https://www.learnentityframeworkcore.com/walkthroughs/existing-database

-1
votes

When creating a new project, there is

  1. Class Library (.Net Standard), at the top of the list, and
  2. Class Library (.Net Framework), somewhere lower in the list

Use the second one.